how I can analyze this magnitude of 1D signal

6 views (last 30 days)
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)).

Accepted Answer

Wayne King
Wayne King on 4 Nov 2013
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 Comments
Wayne King
Wayne King on 4 Nov 2013
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.
ZhG
ZhG on 5 Nov 2013
Edited: ZhG on 5 Nov 2013
I did it as you advised,and I obtain this spectrum (the 2nd is 'detrend' on this graphy). But how can I analyze it ? I mean that how I can obtain some useful information from this graph. Thanks for any advice.

Sign in to comment.

More Answers (1)

Wayne King
Wayne King on 5 Nov 2013
Edited: Wayne King on 5 Nov 2013
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.
  1 Comment
ZhG
ZhG on 5 Nov 2013
Yes, I did the DFT by using 2*pi/N, where N is the length of points number.
x = x-mean(x);
N = length(x); % points number
k = 0:N-1;
w = (2*pi)/N * k;
a1 = [];
xD = 0;
for n=1:N
a1(n,:) = exp(-sqrt(-1)*w*(n))*x(n);
end
xD = -1*sum(a1); % multplied by -1, so that the result equals to fft(a1)
Then, I obtained the abs(xD), as it is shown in the graph. And then I want to obtain one or more measures of this spectrum as a representation or a property of the signal. For example, the maximum magintude in the spectrum. Is this possible?

Sign in to comment.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!