当前位置:网站首页>【Frequency Domain Analysis】Spectral leakage, frequency resolution, picket fence effect
【Frequency Domain Analysis】Spectral leakage, frequency resolution, picket fence effect
2022-08-02 16:46:00 【Zhi Zhao】
信号的频域分析
一、时域加窗
Most signals are continuous in real life,Through the continuous signal sampling get scattered time signal,But the computer can handle data are limited long,So we can do it to the original sequence加窗处理Make it a finite length sequences.
In the case of rectangular window,其时域表达式为:
式(1)中, N = M + 1 N=M+1 N=M+1,The length of the rectangular window.
Add a window on the infinite long sequence processing,Sequence is superior in the time domain to a window function.
By the convolution theorem can get,The time domain convolution of multiplication is equal to the frequency domain.
Set up the simulation signal of time domain expression for:
x ( t ) = A 0 ∗ c o s ( 2 π f 0 t ) + A 1 ∗ c o s ( 2 π f 1 t ) x(t)=A_{0}*cos(2πf_{0}t)+A_{1}*cos(2πf_{1}t) x(t)=A0∗cos(2πf0t)+A1∗cos(2πf1t)
x ( t ) x(t) x(t)做傅里叶变换(FT)的频域表达式为:
X ( j Ω ) = A 0 π δ ( Ω + Ω 0 ) + A 0 π δ ( Ω − Ω 0 ) + A 1 π δ ( Ω + Ω 0 ) + A 1 π δ ( Ω − Ω 0 ) X(jΩ)=A_{0}πδ(Ω+Ω_{0})+A_{0}πδ(Ω-Ω_{0})+A_{1}πδ(Ω+Ω_{0})+A_{1}πδ(Ω-Ω_{0}) X(jΩ)=A0πδ(Ω+Ω0)+A0πδ(Ω−Ω0)+A1πδ(Ω+Ω0)+A1πδ(Ω−Ω0)
连续信号 x ( t ) x(t) x(t)The waveform and spectrum is shown in figure1所示.
连续信号 x ( t ) x(t) x(t)经过采样后,The discrete time expression is in the form of:
x [ n ] = x ( t ) ∣ t = n T s x[n]=x(t)|_{t=nT_{s}} x[n]=x(t)∣t=nTs
离散序列 x [ n ] x[n] x[n]For discrete time Fourier transform(DTFT)的频域表达式为:
X ( e j w ) = 1 T s ∑ k = − ∞ ∞ X ( j w T s − j k 2 π T s ) X(e^{jw})=\frac{1}{T_{s}}\sum_{k=-∞}^{∞}X(j\frac{w}{T_{s}}-jk\frac{2π}{T_{s}}) X(ejw)=Ts1k=−∞∑∞X(jTsw−jkTs2π)
离散序列 x [ n ] x[n] x[n]The waveform and spectrum is shown in figure2所示.
矩形窗函数 w [ n ] w[n] w[n]For discrete time Fourier transform(DTFT)的频域表达式为:
W ( e j w ) = e − j w ( N − 1 ) / 2 ∗ s i n ( w N / 2 ) s i n ( w / 2 ) W(e^{jw})=e^{-jw(N-1)/2} *\frac{sin(wN/2)}{sin(w/2)} W(ejw)=e−jw(N−1)/2∗sin(w/2)sin(wN/2)
矩形窗函数 w [ n ] w[n] w[n]The waveform and spectrum is shown in figure3所示.
离散序列 x [ n ] x[n] x[n]与窗函数 w [ n ] w[n] w[n]的卷积为:
V ( e j w ) = 1 2 π ∫ − π π X ( e j θ ) W ( e j ( w − θ ) ) d θ = A 0 2 W ( e j ( w + w 0 ) ) + A 0 2 W ( e j ( w − w 0 ) ) + A 1 2 W ( e j ( w + w 0 ) ) + A 1 2 W ( e j ( w − w 0 ) ) V(e^{jw})=\frac{1}{2π}\int_{-π}^{π}X(e^{jθ})W(e^{j(w-θ)})dθ=\frac{A_{0}}{2}W(e^{j(w+w_{0})})+\frac{A_{0}}{2}W(e^{j(w-w_{0})})+\frac{A_{1}}{2}W(e^{j(w+w_{0})})+\frac{A_{1}}{2}W(e^{j(w-w_{0})}) V(ejw)=2π1∫−ππX(ejθ)W(ej(w−θ))dθ=2A0W(ej(w+w0))+2A0W(ej(w−w0))+2A1W(ej(w+w0))+2A1W(ej(w−w0))
After the truncation of discrete sequence v [ n ] v[n] v[n]The waveform and spectrum is shown in figure4所示.
频谱泄露
The frequency of the signal components include1MHz和1.05MHz,1MHzThe corresponding amplitudes as1,但是1.05MHzAmplitude reduced,And the other has no small amplitude frequency point.This is the emergence of the phenomenon of frequency spectrum leakage.
Causes of spectrum leakage is what?
Due to the limited computer can only handle long data,So need to sampled signal is truncated,Equivalent to the original signal did add window processing.To add window is superior to signal in time domain signal by a window function,Time the product of the corresponding frequency domain convolution,The window function in the frequency domain including the main lobe and side lobe,Sidelobe caused the signal frequency spectrum leakage.Frequency domain leakage is inevitable,只能减小.
How to restrain the phenomenon?
Can take longer data points,The closer to the original data, the better,But the downside is that the computation increase;
Can choose spectral energy of side lobe smaller window function.
The typical window function,The frequency of the rectangular window highest resolution,Maximum sidelobe leak.
二、频率分辨率
How to calculate the frequency resolution?
In order to facilitate understanding what is the frequency resolution,The frequency resolution can be divided into two types,A waveform frequency resolution is(Waveform Frequency Resolution,Shorthand for waveform resolution),Also known as visual frequency resolution,另一种则为FFT频率分辨率(简记为FFT分辨率).
Waveform resolution:在频谱图中,The smallest interval of two frequency resolution can be,Associated with the length of original signal.
△ R w = 1 T △R_{w}=\frac{1}{T} △Rw=T1
其中, T T TFor the length of the original data.
FFT分辨率:In the spectrum image data points,With the signalFFTCalculation of points about.
△ R f f t = F s N f f t △R_{fft}=\frac{F_{s}}{N_{fft}} △Rfft=NfftFs
其中, F s F_{s} Fs为采样频率, N f f t N_{fft} NfftFor the signalFFTWhen calculating the points.
How to improve the frequency resolution?
例如,A composite signal time domain expression for x ( t ) = c o s ( 2 π f 1 t ) + c o s ( 2 π f 2 t ) x(t)=cos(2πf_{1}t)+cos(2πf_{2}t) x(t)=cos(2πf1t)+cos(2πf2t)
其中 f 1 = 1 M H z f_{1}=1MHz f1=1MHz, f 2 = 1.05 M H z f_{2}=1.05MHz f2=1.05MHz. x ( t ) x(t) x(t)The waveform and spectrum is shown in figure6所示.
By the above spectrum can be found in the,在1MHzNear the two frequency aliasing,无法有效区分1MHz和1.05MHz,Shows the frequency resolution is not enough.
The time domain data are zero padding,Can change the frequency resolution?For example, in the original data points behind add6000个数值为0的点,Has no effect on the signal itself data,Just increased participation inFFTThe calculation of data points,Get the signal waveform and spectrum is shown in figure7所示.
Based on the original data for补零操作,Data points in the spectrum image more intensive.But I still can't distinguish between1MHz和1.05MHz,Prove that the signal waveform frequency resolution and participate inFFTThe calculation of data points N f f t N_{fft} Nfft无关,Only with the length of the original data T T T有关.Zero padding on the time-domain equivalent to the frequency domain interpolation on,The increased frequency points,The spectrum curve becomes more smooth,即增加了FFT频率分辨率.
为了有效区分1MHz和1.05MHz,Must extend the length of the original data in order to improve the waveform resolution.At the same sampling frequency of the original signal sampling,采集7000个数据点.Get the signal waveform and spectrum is shown in figure8所示.
有图8可见,1MHz和1.05MHzCan be separate,But also appeared a phenomenon of frequency spectrum leakage.The signal waveform resolution of at this time: △ R w = 1 70 u s ≈ 14 K H z △R_{w}=\frac{1}{70us}≈14KHz △Rw=70us1≈14KHz,小于1MHz和1.05MHz之间的距离 50 K H z 50KHz 50KHz.
In order to reduce spectral leakage,The original signal take longer data points,采集8000个数据点.Get the signal waveform and spectrum is shown in figure9所示.
由图9可知,1MHz和1.05MHzThe corresponding amplitudes are1,And can effectively distinguish,The signal at this timeFFT分辨率为: △ R f f t = F s 8000 = 12.5 K H z △R_{fft}=\frac{F_{s}}{8000}=12.5KHz △Rfft=8000Fs=12.5KHz,刚好是1MHz和1.05MHz的公约数,即 1 M H z = 12.5 K H z × 80 1MHz=12.5KHz×80 1MHz=12.5KHz×80, 1.05 M H z = 12.5 K H z × 84 1.05MHz=12.5KHz×84 1.05MHz=12.5KHz×84.
So take the proper length of data points can reduce the spectrum leakage.
三、频域采样
周期序列的DFS的系数 X ( k ) X(k) X(k)与 x ( n ) x(n) x(n)A cycle of Z Z ZTransformation in the unit circle N N NA uniform point sampling values are equal,This is the frequency domain sampling.
频域采样定理:
当 N ≥ L N≥L N≥L,即DFTCalculate the length of the points will be greater than or equal to the signal in frequency domain sampling,Frequency domain sampling will not result in time domain aliasing.
有限长序列 x ( n ) x(n) x(n)的 Z Z Z变换为:
X ( Z ) = ∑ n = 0 N − 1 x ( n ) Z − n = ∑ n = 0 N − 1 [ 1 N ∑ k = 0 N − 1 X ( k ) W N − k n ] Z − n = 1 − Z − N N ∑ k = 0 N − 1 X ( k ) 1 − W N − k Z − 1 X(Z)=\sum_{n=0}^{N-1}x(n)Z^{-n}=\sum_{n=0}^{N-1}[\frac{1}{N}\sum_{k=0}^{N-1}X(k)W_{N}^{-kn}]Z^{-n}=\frac{1-Z^{-N}}{N}\sum_{k=0}^{N-1}\frac{X(k)}{1-W_{N}^{-k}Z^{-1}} X(Z)=n=0∑N−1x(n)Z−n=n=0∑N−1[N1k=0∑N−1X(k)WN−kn]Z−n=N1−Z−Nk=0∑N−11−WN−kZ−1X(k)
其中, W N − k n = e j 2 π k n N W_{N}^{-kn}=e^{j\frac{2πkn}{N}} WN−kn=ejN2πkn, W N − k = e j 2 π k N W_{N}^{-k}=e^{j\frac{2πk}{N}} WN−k=ejN2πk.
栅栏效应
在进行DFTCalculations need frequency domain of signal sampling,Due to the sampling interval as △ w = 2 π N △w=\frac{2π}{N} △w=N2π,The spectrum diagrams are composed of discrete spectral lines of a root,Like watch on location through the fence.
How to alleviate the fence effect?
The increase in frequency domain sampling pointsN(Don't change the time domain data under the condition of,在时域数据末端添加一些零值点,使得谱线更密),Narrow spectral line spacing,Reduce the fence effect.
四、MATLAB代码
%% 1000Data points of the waveform and spectrum
clc;
clear;
close all;
Fs = 100e6; % 采样频率
f1 = 1e6;f2 = 1.05e6; % 信号的频率
T = 1/Fs; % 采样周期
L0 = 1000; % 信号长度
L = 1000; % 数据长度
t0 = (0:L0-1)*T; % Signal time series
t = (0:L-1)*T; % The data time series
x = cos(2*pi*f1*t0)+cos(2*pi*f2*t0); % 原始信号
% FFT
[f1,A1] = PinPu(x,Fs);
figure(1)
subplot(1,2,1);plot(t*1e6,x);
xlabel('t/us');title('时域');
subplot(1,2,2);plot(f1,A1);
xlabel('f/Hz');title('频域');xlim([0 2e6]);
%% The spectrum leakage phenomena
clc;
clear;
close all;
Fs = 100e6; % 采样频率
f1 = 1e6;f2 = 1.05e6; % 信号的频率
T = 1/Fs; % 采样周期
L0 = 7000; % 信号长度
L = 7000; % 数据长度
t0 = (0:L0-1)*T; % Signal time series
t = (0:L-1)*T; % The data time series
x = cos(2*pi*f1*t0)+cos(2*pi*f2*t0); % 原始信号
% FFT
[f1,A1] = PinPu(x,Fs);
figure(1)
subplot(1,2,1);plot(t*1e6,x);
xlabel('t/us');title('时域');
subplot(1,2,2);plot(f1,A1);
xlabel('f/Hz');title('频域');xlim([0 2e6]);
%% 8000Data points of the waveform and spectrum,Enhance the frequency resolution.
clc;
clear;
close all;
Fs = 100e6; % 采样频率
f1 = 1e6;f2 = 1.05e6; % 信号的频率
T = 1/Fs; % 采样周期
L0 = 8000; % 信号长度
L = 8000; % 数据长度
t0 = (0:L0-1)*T; % Signal time series
t = (0:L-1)*T; % The data time series
x = cos(2*pi*f1*t0)+cos(2*pi*f2*t0); % 原始信号
% FFT
[f1,A1] = PinPu(x,Fs);
figure(1)
subplot(1,2,1);plot(t*1e6,x);
xlabel('t/us');title('时域');
subplot(1,2,2);plot(f1,A1);
xlabel('f/Hz');title('频域');xlim([0 2e6]);
参考文献
[1] 数字信号处理
[2] Fourier transform of the frequency and waveform resolution
[3] 补零、频谱泄露、Fence effect relationship?
边栏推荐
- DOM - Event Mechanism and Event Chain
- 【QMT】给QMT量化交易软件安装和调用第三方库(举例通达信pytdx,MyTT,含代码)
- CSV file with the data read and write 】 【 XLS/XLSX file
- MATLAB file operations
- 有效的括号【暴力、分支判断、哈希表】
- 【JS执行机制】
- 2021 annual summary - complete a year of harvest
- Based on the SVM regression forecast 】 【 LibSVM realize the prediction of a characteristic data
- XML技术
- golang时间-时间戳的获取-转换-计算
猜你喜欢
随机推荐
【web渗透】文件包含漏洞入门级超详细讲解
为什么四个字节的float表示的范围比八个字节的long要广
网络运维系列:Ubnt ER-X初始化和开启硬件NAT
test3
2022-07-16 第五小组 瞒春 学习笔记
lammps聚合物建模——EMC
MATLAB文件操作
nvm管理node版本 nodenpm不是内部或外部命令,也不是可运行的程序
makefile——杂项
Jenkins 参数化构建(Extended Choice Parameter)
第四章-4.1-最大子数组问题
DOM —— 事件机制及事件链
Nvm,Nrm使用教程
只出现一次的数字||| —— 哈希映射、异或位运算+分治思想
VLAN原理
Servlet 技术1
Window function method for FIR filter design
Filter 过滤器
DOM - Event Mechanism and Event Chain
延时函数-定时器