Thank you for the code. Can you get total power of a signal from this?
Also, this may be too much to ask, but can you find:
(1) the frequency below which 50% of the total power is present and
(2) the frequency below which 95% of the total power is present?
Thank you in advance,
Sarah

Thank you for the code. Can you get total power of a signal from this?
Also, this may be too much to ask, but can you find:
(1) the frequency below which 50% of the total power is present and
(2) the frequency below which 95% of the total power is present?
Thank you in advance,
Sarah

Hi, I enter the following...
t=[0:0.0001:40];
v=sin(2*pi.*t)+cos(5*pi.*t)+sin(7*pi.*t)+sin(12*pi.*t)+cos(15*pi.*t)+sin(17*pi.*t)+sin(22*pi.*t)+cos(25*pi.*t)+sin(27*pi.*t)+sin(32*pi.*t);
[f,U]=Spectrum_Analyser(t,v,1,40,0.001);
...and I get frequencies of 1, 2.5, 3.5, 6, 7.5, 8.5, 11, 12.5, 13.5, 16.
But I was expecting 2, 5, 7, 12, 15, 17, 22, 25, 27, 32.
Why is that?

I am new in MATLAB spectram analtsis. any body tell me how to run this code. when i try to run this code the following error is coming:
??? Input argument "t" is undefined.
Error in ==> Spectrum_Analyser at 28
[x,y]=maxima(t,v);

Comment only