Fundamental of power spectral density PSD?
8 views (last 30 days)
Show older comments
,How can specifying the Fundamental?can I take mean value? How can I specifying all other harmonic in this signal ,first ,second harmonic and so on? for this code ?
Fs = 150;
t = 0:1/Fs:1;
x = cos(2*pi*10*t);
%filter from DC component
x=x';
Sig2=x;
w333 =kaiser(151,3.5); %windowing by kaiser window
Sig2 = Sig2.*w333;
SigDFT = fft(Sig2,512);
SigDFT = SigDFT(1:257);
plot(abs(SigDFT))
plot(Sig2); grid on;
0 Comments
Accepted Answer
Wayne King
on 28 Dec 2013
Are these two peaks harmonically related? In other words, is the second peak an integer multiple of the first peak. In that case, it is customary to call the lower frequency peak the fundamental and subsequent integer multiples of that peak are the higher harmonics.
5 Comments
Wayne King
on 28 Dec 2013
And I need to know how you obtained that PSD estimate. In other words, what is the sampling frequency of the time data, show the MATLAB code you used, without that information nobody knows what the physical frequencies are.
More Answers (2)
Wayne King
on 28 Dec 2013
Edited: Wayne King
on 28 Dec 2013
The answer is you are only seeing one peak in your signal. When you obtain a two-sided (negative and positive frequencies) PSD estimate of a real-valued signal, each real-valued sine wave results in two peaks (it is a sum or difference of two complex exponentials).
You can remove this redundancy by just retaining one side, which I show you how to do below.
A=sum(c1);
AVE1=A/32;
w=c1-AVE1; %filter from DC component
w=w';
Sig2=w;
w333 =kaiser(32,3.5); %windowing by kaiser window
Sig2 = Sig2.*w333;
SigDFT = fft(Sig2,512);
SigDFT = SigDFT(1:257);
plot(abs(SigDFT))
Now to determine the physical frequency corresponding to that peak, you must tell me what the sampling frequency or sampling interval is. For each pair of elements in your signal, cl, what is the separation between them in time or space?
You can clearly see just by plotting the "time" signal
plot(Sig2); grid on;
That the period is about 12 samples, but without knowing the difference between those samples, nobody can tell what that frequency is other than saying it's about 1 cycle per 12 samples.
5 Comments
Wayne King
on 28 Dec 2013
There really doesn't appear to be other harmonics present, but do you have the Signal Processing Toolbox? If so there is a function for that thd()
Wayne King
on 29 Dec 2013
Edited: Wayne King
on 29 Dec 2013
There is only one sine wave in this signal. There are no harmonics.
Fs = 150;
t = 0:1/Fs:1;
x = cos(2*pi*10*t);
%filter from DC component
x=x';
Sig2=x;
w333 =kaiser(151,3.5); %windowing by kaiser window
Sig2 = Sig2.*w333;
NFFT = 512;
SigDFT = fft(Sig2,NFFT);
SigDFT = SigDFT(1:NFFT/2+1);
plot(abs(SigDFT))
To create a meaningful frequency vector.
df = Fs/NFFT;
freqvec = 0:df:Fs/2;
plot(freqvec,abs(SigDFT))
Now you see in the above plot that the peak is at 10 Hz. This is what I have been trying to tell you. You have to know the sampling frequency.
0 Comments
See Also
Categories
Find more on Time-Frequency Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!