band of a fft signal
12 次查看(过去 30 天)
显示 更早的评论
How can I calculate the frequency band of a Fourier Transformed signal?
In vector X I have the values of my aperiodic signal
Then I do fft(X), so I have my signal in function of frequency
Now how can I know its band?
0 个评论
采纳的回答
Wayne King
2011-9-28
Hi, you have to know the sampling frequency of your input. If you have the Signal Processing Toolbox, the easiest way is to use spectrum.periodogram because that does a lot of the work for you.
I'll assume that your sampling frequency is 1000 Hz for this example.
Fs = 1e3;
t = 0:1/Fs:1-(1/Fs);
x = cos(2*pi*100*t)+sin(2*pi*200*t)+randn(size(t));
plot(psd(spectrum.periodogram,x,'Fs',1e3,'NFFT',length(x)));
With fft(), note I have not scaled the output to exactly match spectrum.periodogam, but that is easy.
xdft = fft(x);
xdft = xdft(1:length(x)/2+1);
freq = 0:Fs/length(x):Fs/2;
figure;
plot(freq,20*log10(abs(xdft)));
0 个评论
更多回答(1 个)
UJJWAL
2011-9-28
Hi biomed,
The band of a signal depends upon your interpretation. Usually the band of a signal refers to the maximum frequency present minus the minimum frequency present in the signal. However depending upon the applications, some frequencies or frequency ranges may be insignificant for us and hence we may not consider them while dealing with the bands.
For example if the frequencies below 100 Hz are ingsignificant to us and the maximum frequency present is 200 Hz then the band will simply be called as 100 Hz in most of the cases. Below is a program that plots the frequency content of a signal that is the magnitude of its fourier transform. Take a look at the signal and try to play with the definition of the signal s. In different cases you will see different frequency contents .
fs=100; %This is the sampling frequency.
t = 0:1/fs:5;
s = sin(t.^2 + 100*t ); % The definition of the signal
NFFT = 2^(nextpow2(length(t))); % Number of FFT Points minimum required
y = abs(fft(s,NFFT)/length(t)); % Finding out the magnitude and normalizing it
g= fftshift(y); % To bring the zero frequency to the center
plot(((-NFFT/2:NFFT/2 -1)/NFFT)*fs,g); % Plotting the fourier transform (magnitude)
In the given example you can see that there is a lobe between 10 Hz and 20 Hz and after 40 Hz the frequency content is insignificant . So depending on applications where such small contents are insignificant , the band might even be called 20Hz - 10 Hz = 10 Hz. The band is usually expressed as twice of this to also take into account the negetive frequencies.
For further details mail back of reply.
Hope this will help
HAPPY TO HELP
UJJWAL grid on; xlabel('Frequency\rightarrow','fontsize',18); ylabel('|H(f)|\rightarrow','fontsize',18); title('FFT','fontsize',20);
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spectral Measurements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!