Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
display distribution of energy one-dimensional signal by wavelet

Subject: display distribution of energy one-dimensional signal by wavelet

From: maryam tlb

Date: 17 Aug, 2011 18:31:13

Message: 1 of 5

Hi Dear all

I read wdecenergy ,i have some question about it. i don't realize it ! what does
PECFS_1 show exactly?
in fact ,i want to get detail spectral energy of one dimensional signal where horzintal axises is Time and vertical axis is amplitude?i don't know how should i write code for it ?

hopping for helping
Best Regards.
% Load a one-dimensional signal.
load sumsin;
 s = sumsin;

% Perform decomposition at level 3 of s using db4.
[c,l] = wavedec(s,3,'db4');
D1 = wrcoef('d',c,l,'db4',1);

%Compute spectral energy and plot it?
????

Subject: display distribution of energy one-dimensional signal by wavelet

From: Wayne King

Date: 17 Aug, 2011 18:46:10

Message: 2 of 5

"maryam tlb" <maryam.talebi1365@gmail.com> wrote in message <j2h1dh$6nf$1@newscl01ah.mathworks.com>...
> Hi Dear all
>
> I read wdecenergy ,i have some question about it. i don't realize it ! what does
> PECFS_1 show exactly?
> in fact ,i want to get detail spectral energy of one dimensional signal where horzintal axises is Time and vertical axis is amplitude?i don't know how should i write code for it ?
>
> hopping for helping
> Best Regards.
> % Load a one-dimensional signal.
> load sumsin;
> s = sumsin;
>
> % Perform decomposition at level 3 of s using db4.
> [c,l] = wavedec(s,3,'db4');
> D1 = wrcoef('d',c,l,'db4',1);
>
> %Compute spectral energy and plot it?
> ????

Hi, You already posted this question. Have you read the other post.

http://www.mathworks.com/matlabcentral/newsreader/view_thread/311655#849426

The way you have worded your question this time, perhaps the wavelet packet spectrum is a better idea:

load sumsin
wpt = wpdec(sumsin,3,'db4');
[spec,times,freqs] = wpspectrum(wpt,1,'plot');

Note that sumsin is not a terribly interesting signal for this since the 3 component sine waves occur at all times in the signal.

A better example is:

fs = 500;
t = 0:1/fs:4;
y = sin(32*pi*t).*(t<2) + sin(128*pi*t).*(t>=2);
subplot(2,1,1);
plot(t,y);
axis tight
title('Analyzed Signal');

% Wavelet packet spectrum
level = 6;
wpt = wpdec(y,level,'sym6');
subplot(2,1,2);
[S,T,F] = wpspectrum(wpt,fs,'plot');

Wayne

Subject: display distribution of energy one-dimensional signal by wavelet

From: maryam tlb

Date: 17 Aug, 2011 20:57:09

Message: 3 of 5

"Wayne King" <wmkingty@gmail.com> wrote in message <j2h29i$9pd$1@newscl01ah.mathworks.com>...
> "maryam tlb" <maryam.talebi1365@gmail.com> wrote in message <j2h1dh$6nf$1@newscl01ah.mathworks.com>...
> > Hi Dear all
> >
> > I read wdecenergy ,i have some question about it. i don't realize it ! what does
> > PECFS_1 show exactly?
> > in fact ,i want to get detail spectral energy of one dimensional signal where horzintal axises is Time and vertical axis is amplitude?i don't know how should i write code for it ?
> >
> > hopping for helping
> > Best Regards.
> > % Load a one-dimensional signal.
> > load sumsin;
> > s = sumsin;
> >
> > % Perform decomposition at level 3 of s using db4.
> > [c,l] = wavedec(s,3,'db4');
> > D1 = wrcoef('d',c,l,'db4',1);
> >
> > %Compute spectral energy and plot it?
> > ????
>
> Hi, You already posted this question. Have you read the other post.
>
> http://www.mathworks.com/matlabcentral/newsreader/view_thread/311655#849426
>
> The way you have worded your question this time, perhaps the wavelet packet spectrum is a better idea:
>
> load sumsin
> wpt = wpdec(sumsin,3,'db4');
> [spec,times,freqs] = wpspectrum(wpt,1,'plot');
>
> Note that sumsin is not a terribly interesting signal for this since the 3 component sine waves occur at all times in the signal.
>
> A better example is:
>
> fs = 500;
> t = 0:1/fs:4;
> y = sin(32*pi*t).*(t<2) + sin(128*pi*t).*(t>=2);
> subplot(2,1,1);
> plot(t,y);
> axis tight
> title('Analyzed Signal');
>
> % Wavelet packet spectrum
> level = 6;
> wpt = wpdec(y,level,'sym6');
> subplot(2,1,2);
> [S,T,F] = wpspectrum(wpt,fs,'plot');
>
> Wayne


Hi Dear Wayne

First,thanks so much for your helping.i use your code in matlab(command window) but matlab has this error:

??? Undefined function or method 'wpspectrum' for input arguments of type
'wptree'.

what this?
in product help of matlab "wpspectrum" is unknown?! why?
 

Subject: display distribution of energy one-dimensional signal by wavelet

From: Steven_Lord

Date: 17 Aug, 2011 21:16:52

Message: 4 of 5



"maryam tlb" <maryam.talebi1365@gmail.com> wrote in message
news:j2h9v5$6gi$1@newscl01ah.mathworks.com...
> "Wayne King" <wmkingty@gmail.com> wrote in message
> <j2h29i$9pd$1@newscl01ah.mathworks.com>...
>> "maryam tlb" <maryam.talebi1365@gmail.com> wrote in message
>> <j2h1dh$6nf$1@newscl01ah.mathworks.com>...

*snip*

> First,thanks so much for your helping.i use your code in matlab(command
> window) but matlab has this error:
>
> ??? Undefined function or method 'wpspectrum' for input arguments of type
> 'wptree'.
>
> what this?
> in product help of matlab "wpspectrum" is unknown?! why?

What version of Wavelet Toolbox do you have? This page from the Release
Notes indicate that WPSPECTRUM was introduced in version 4.6 (release
R2010b) so if you're using an older version you will not be able to use this
function.

http://www.mathworks.com/help/toolbox/wavelet/rn/bsljefa.html

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: display distribution of energy one-dimensional signal by wavelet

From: maryam tlb

Date: 17 Aug, 2011 22:49:10

Message: 5 of 5

"Steven_Lord" <slord@mathworks.com> wrote in message <j2hb45$a53$1@newscl01ah.mathworks.com>...
>
>
> "maryam tlb" <maryam.talebi1365@gmail.com> wrote in message
> news:j2h9v5$6gi$1@newscl01ah.mathworks.com...
> > "Wayne King" <wmkingty@gmail.com> wrote in message
> > <j2h29i$9pd$1@newscl01ah.mathworks.com>...
> >> "maryam tlb" <maryam.talebi1365@gmail.com> wrote in message
> >> <j2h1dh$6nf$1@newscl01ah.mathworks.com>...
>
> *snip*
>
> > First,thanks so much for your helping.i use your code in matlab(command
> > window) but matlab has this error:
> >
> > ??? Undefined function or method 'wpspectrum' for input arguments of type
> > 'wptree'.
> >
> > what this?
> > in product help of matlab "wpspectrum" is unknown?! why?
>
> What version of Wavelet Toolbox do you have? This page from the Release
> Notes indicate that WPSPECTRUM was introduced in version 4.6 (release
> R2010b) so if you're using an older version you will not be able to use this
> function.
>
> http://www.mathworks.com/help/toolbox/wavelet/rn/bsljefa.html
>
> --
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com
hi steve

oh ,really? now can i use it?do i buy matlab version 4.6? it's very expenssive for me ! how can i use without buying new version matlab?

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us