简体   繁体   English

Matlab中的fft / ifft反卷积

[英]fft / ifft deconvolution in Matlab

I have a time varying signal (time,amplitude) and a measured frequency sensitivity (frequency,amplitude conversion factor (Mf)). 我有一个随时间变化的信号(时间,幅度)和一个测得的频率灵敏度(频率,幅度转换因子(Mf))。

I know that if I use the center frequency of my time signal to select the amplitude conversion factor (eg 0.0312) for my signal I get a max. 我知道,如果我使用时间信号的中心频率为信号选择幅度转换因子(例如0.0312),则会得到最大值。 converted amplitude value of 1.4383. 转换后的幅度值为1.4383。

I have written some code to deconvolve the time varying signal and known sensitivity (ie for all frequencies). 我编写了一些代码来对时变信号和已知的灵敏度(即对于所有频率)进行反卷积。

where Pt is the output/converted amplitude and Mf is amplitude conversion factor data and fft(a) is the fft of the time varying signal (a). 其中Pt是输出/转换后的振幅,Mf是振幅转换因子数据,而fft(a)是时变信号(a)的fft。

I take the real part of the fft(a): 我是fft(a)的真正组成部分:

xdft = fft(a);
xdft = xdft(1:length(x)/2+1); % only retaining the positive frequencies
freq = Fs*(0:(L/2))/L; 

where Fs is sampling frequency and L is length of signal. 其中Fs是采样频率,L是信号长度。

convS = real(xdft).*Mf;

assuming Mf is magnitude = real (I don't have phase info). 假设Mf为幅度=实数(我没有相位信息)。 I also interpolate 我也插值

Mf=interp1(freq_Mf,Mf_in,freq,'cubic');

so at the same interrogation points as freq. 因此在与频率相同的询问点上

I then reconstruct the signal in time domain using: 然后,我使用以下方法在时域中重构信号:

fftRespI=complex(real(convS),imag(xdft));

pt = ifft(fftRespI,L,'symmetric')

where I use the imaginary part of the fft(a). 在这里我使用fft(a)的虚部。

The reconstructed signal shape looks correct but the amplitude of the signal is not. 重建的信号形状看起来正确,但信号幅度却不正确。

If I set all values of Mf = 0.0312 for f=0..N MHz I expect a max. 如果我为f = 0..N MHz设置所有Mf = 0.0312的值,则我期望最大 converted amplitude value of ~1.4383 (similar to if I use the center frequency) but I get 13.0560. 转换后的振幅值为〜1.4383(类似于我使用中心频率的情况),但得到13.0560。

How do I calibrate the amplitude axis? 如何校准振幅轴? ie how do I correctly multiply fft(a) by Mf? 即我如何正确地将fft(a)乘以Mf?

Some improved understanding of the y axis of the abs(magnitude) and real FFT would help me I think... 我认为对abs(幅度)的y轴和真实FFT的一些更好的了解将对我有所帮助...

thanks 谢谢

You need to re-arrange the order of your weights Mf to match the MATLAB's order for the frequencies. 您需要重新排列权重Mf的顺序,以匹配MATLAB的频率顺序。 Let's say you have a signal 假设您有一个信号

N=10;
x=randn(1,N);
y=fft(x);

The order of the frequencies in the output y is 输出y中的频率顺序为

[0:1:floor(N/2)-1,floor(-N/2):1:-1] = [0 1 2 3 4 -5 -4 -3 -2 -1]

So if your weights 所以如果你的体重

Mf = randn(1,N)

are defined in this order: Mf == [0 1 2 3 4 5 6 7 8 9] , you will have to re-arrange 按以下顺序定义: Mf == [0 1 2 3 4 5 6 7 8 9] ,您将不得不重新安排

Mfshift = [Mf(1:N/2), fliplr(Mf(2:(N/2+1)))];

and then you can get your filtered output 然后可以得到过滤后的输出

z = ifft(fft(x).*Mshift);

which should come out real. 应该是真实的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM