当前位置:网站首页>信号处理中的反傅里叶变换(IFFT)原理
信号处理中的反傅里叶变换(IFFT)原理
2022-07-29 04:08:00 【smartisong】
信号处理中,经常需要将信号转换到频域进行分析,有时候还会从频域转回时域,用到FFT和IFFT函数。
FFT变换是将信号从时域转换到频域,在时域看起来复杂的信号转换到频域看起来就方便容易了很多。但有时候也需要将频域信号转换到时域,所以这时需要用到IFFT变换。
其实IFFT的计算原理之一就是将频域(注意频域是复数)数据进行取共轭复数(虚部取反),然后再进行FFT变换,这样便将频域信号转换到时域。因为FFT变换的结果是复数,所以从频域进行FFT变换过来的结果也是复数,而此时只需取复数的实部,便是原时域信号(同时此复数的虚部已经比非常小了,就省略不要了)。
注意:FFT以后数列是共扼对称排列的顺序,当把某个范围频率的数据清另,必须将与它共扼对称的频率数据也清另,不可少清,也不可多清,这样就不会出来复数了。
在MATLAB中,通过计算MATLAB自带的IFFT函数和FFT结果进行虚部取反再计算FFT。两种方法表明:结果一致。
%% 将正弦波做FFT计算,50%的重叠。验证IFFT的计算——对比自带函数IFFT函数,和对FFT结果取共轭,再进行FFT计算的区别。
clear;clf;
Fs=24000;t = 0:1/Fs:0.07;y=sin(200*2*pi*t+50); % 24k采样率下,生成200Hz、0.07秒正弦波
i=(floor(length(y)/512)-1)*2; % 因为分帧计算,这里计算循环次数。因为要50%的重叠,所以需要乘以2
yfft=zeros(1,length(y)); % 初始化函数
yifft=zeros(1,length(y)); % 初始化函数
Windows=hamming(512); % 取窗函数
for a =0:i
StartPoint=1+256*a;
y0(1:512)=y(StartPoint:(StartPoint+512-1)); %取每次要处理的512个数据
y0=y0.*Windows'; % 加窗
TempData=fft(y0); % 做FFT计算
Yifft=ifft(TempData); % MATLAB自带IFFT函数
Yfft=conj(TempData); % 取共轭复数
Yfft=fft(Yfft); % 虚部取反做FFT计算
Yfft=(real(Yfft)/512)*0.98; % 取出实部,并对其除以N。乘以0.98为了做图进行对比
yfft(StartPoint:StartPoint+512-1)=yfft(StartPoint:StartPoint+512-1)+Yfft; %重组
yifft(StartPoint:StartPoint+512-1)=yifft(StartPoint:StartPoint+512-1)+Yifft; %重组
end
%% 作图
figure(1);
plot(y,'*'); hold on
plot(yfft,'r'); hold on ;
plot(yifft,'k'); grid on
legend('原信号时域','虚部取反做fft时域','Ifft时域');
xlabel('时域(t)');
ylabel('幅值');
边栏推荐
- Data mining -- Introduction to the basis of association analysis (Part 1)
- 数据集成这个地方的过滤条件该咋写,用的啥语法?sql语法处理bizdate可以不
- Simple cases of inner connection and left connection
- AssertionError(“Torch not compiled with CUDA enabled“)
- LDP --- 标签分发协议
- Data mining -- code implementation of association analysis example (Part 2)
- 第一个ALV程序2
- 【BGP】小型实验
- %s. %c, character constant, string constant, const char*, pointer array, string array summary
- The structure pointer must be initialized, and the pointer must also be initialized
猜你喜欢
Lua语言(stm32+2G/4G模块)和C语言(stm32+esp8266)从字符串中提取相关数据的方法-整理
【BGP】小型实验
Is the array name a pointer
Summary on the thought of double pointer
nacos注册中心
Big manufacturers finally can't stand "adding one second", and companies such as Microsoft, Google meta propose to abolish leap seconds
[原理] 横向渗透的几种方式
When array is used as a function parameter, it is better to use the array size as a function parameter
Press the missing number of interview question 17.04 | | 260. the number that appears only once (including bit operation knowledge points)
Zhihuijun, a genius of Huawei, made a modular mechanical keyboard, which caused an earthquake in the geek circle. Netizens: This is the real customization
随机推荐
C语言实现三子棋游戏(详解)
pat A1041 Be Unique
优炫数据库有办法查到主集群每天传给备集群的日志量吗?
【BGP】小型实验
LCA board
Codeforces round 810 (Div. 2) d. rain (segment tree difference)
nacos注册中心
Lua language (stm32+2g/4g module) and C language (stm32+esp8266) methods of extracting relevant data from strings - collation
HCIP BGP
Routing knowledge
UCOS task switching process
Ma Zhixing entered the mass production of front loading, starting with the self-developed domain controller?
[deep learning CPU (part outside) - virtual memory]
2021 sist summer camp experience + record post of School of information, Shanghai University of science and technology
LDP --- 标签分发协议
淘宝商品详情接口(商品详情页面数据接口)
数据库SQL语句实现数据分解的函数查询
How to write the filter conditions of data integration and what syntax to use? SQL syntax processing bizdate can not be
Deep understanding of browser caching mechanism (HTTP)
店铺排名问题,如何解决?