Fundamental of power spectral density PSD?
10 次查看(过去 30 天)
显示 更早的评论
,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 个评论
采纳的回答
Wayne King
2013-12-28
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 个评论
Wayne King
2013-12-28
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.
更多回答(2 个)
Wayne King
2013-12-28
编辑:Wayne King
2013-12-28
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 个评论
Wayne King
2013-12-28
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
2013-12-29
编辑:Wayne King
2013-12-29
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Time-Frequency Analysis 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!