傅里叶变换-理解3

来源:互联网 发布:淘宝品控怎么处理 编辑:程序博客网 时间:2024/06/06 02:10

转自:http://www.guokr.com/blog/440583/

傅里叶变换的一大用途是从混杂的时域信号中找出其中各频率成分的分布。
以一个由50Hz、120Hz两个频率正弦信号和随机噪声叠加得到的信号为例(采样频率1000Hz):
A common use of Fourier transforms is to find the frequency components of a signal buried in a noisy time domain signal. Consider data sampled at 1000 Hz. Form a signal containing 50 Hz and 120 Hz and corrupt it with some zero-mean random noise:

t = 0:0.001:0.6;
x = sin(2*pi*50*t)+sin(2*pi*120*t);
y = x + 2*randn(size(t));
plot(1000*t(1:50),y(1:50));
title('Signal Corrupted with Zero-Mean Random Noise');
xlabel('time (milliseconds)');

直接观察这个信号,我们看不出它是由哪些频率的正弦信号叠加而成。
对信号y作快速傅里叶变换得到它的离散频谱Y:
It is difficult to identify the frequency components by looking at the original signal. Converting to the frequency domain, the discrete Fourier transform of the noisy signal y is found by taking the 512-point fast Fourier transform (FFT):

Y = fft(y,512);

其能量谱(表明各个频率分量的能量大小)为:
The power spectrum, a measurement of the power at various frequencies, is

Pyy = Y.* conj(Y) / 512;

取前257个点,画出信号y的能量谱(FFT的结果是圆周共轭对称的,实部偶对称,虚部奇对称,所以能量谱线是相对于N/2点对称的。):
Graph the first 257 points (the other 255 points are redundant) on a meaningful frequency axis:

f = 1000*(0:256)/512;
plot(f,Pyy(1:257))
title('Frequency content of y')
xlabel('frequency (Hz)')

该图像表示信号y中从直流分量到奈奎斯特频率各频率分量的能量大小。从图上可以直观地看出信号的主要频率成分一个是50Hz,另一个在100Hz到150Hz之间,大约在120Hz处。
同时可以看到,这个图像上有明显的峰。
This represents the frequency content of y in the range from DC up to and including the Nyquist frequency. (The signal produces the strong peaks.)

0 0
原创粉丝点击