how I can analyze this magnitude of 1D signal
6 次查看(过去 30 天)
显示 更早的评论
This is a DFT magnitude graph of a set of 1D points. How can I analyze it? Can I say that the lowest frequency contribute most or the 0 frequency contribute most? It is not 0 frequency, isn't it? The 0 frequency is DC component before getting magnitude with abs(fft(s1)).
0 个评论
采纳的回答
Wayne King
2013-11-4
If the large value shown in the figure corresponds to 0 frequency, then that simply means the signal has a nonzero DC value. The 0 frequency component in the DFT is simply the sum of all elements in the input signal, or N times the mean value of the signal, where N is the number of elements in the signal.
Quite often, the zero frequency component is not of interest when doing a frequency analysis. To remove that, simply remove the mean from the signal.
For example, compare:
Fs = 1000;
t = 0:1/Fs:1-1/Fs;
x = 20+cos(2*pi*100*t)+randn(size(t));
xdft = fft(x);
xdft = xdft(1:length(x)/2+1);
plot(abs(xdft))
% remove mean
xnew = x-mean(x);
xdftnew = fft(xnew);
xdftnew = xdftnew(1:length(x)/2+1);
plot(abs(xdftnew))
3 个评论
Wayne King
2013-11-4
Yes, I would say so, because you don't need to have the DFT to know what the zero frequency component is, sum(x) will give you that information.
更多回答(1 个)
Wayne King
2013-11-5
编辑:Wayne King
2013-11-5
You have a real-valued signal, so you only need 1/2 your magnitudes. I can't tell from your graph if your signal has even length or odd length. I'll assume length 52
Each frequency bin has spacing Fs/N Hz where N is the length of the signal and Fs is the sampling frequency. If you are just using normalized frequency, then the spacing is (2*pi)/N radians/sample.
n = 0:51;
x = cos((2*pi)/13*n);
xdft = fft(x);
xdft = xdft(1:length(x)/2+1);
stem(abs(xdft))
The sine wave has a frequency of (2*pi)/13 radians/sample. The spacing of the "bins" in the DFT is (2*pi)/52 radians/sample. Because the first bin xdft(1) corresponds to zero frequency, you expect the frequency of (2*pi)/13 radians/sample to fall on xdft(5), which it does.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Digital Filter Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!