【发布时间】:2017-10-10 23:19:23
【问题描述】:
我试图从其单面离散傅里叶变换中得到一个真正的小波w,它是一个列向量。根据理论,负频侧是正频侧的复共轭,但是在Matlab中实现它(使用ifft函数)让我很头疼。
下面,我列出了一个小程序,它将阻尼正弦小波w 转换为频域W,然后提取正部分并用conj(flipud(W)) 进行扩充,但它的逆 FFT 看起来就像我的输入小波幅度用其他东西调制一样。但是,w = ifft(W,'symmetric') 工作正常。任何识别问题的建议都将受到高度赞赏。
这里是列表:
clc; clear all
% Genetate a damped sine wavelet
n = 100;
n2 = floor(n/2)+ 1;
dt = .25;
for i = 1:n
t = (i-1)*dt;
w(i,1) = 100 * sin(t) * exp(-0.2*t);
end
figure; subplot(3,2,1); plot(w);
title('The Signal')
%-------------------------------------
W1 = fft(w); % 2-sided
n2 = floor(n/2)+ 1;
W2 = fft(w,n2); % 1-sided
subplot(3,2,3);plot(real(W2));
title('2-sided abs(W2)')
subplot(3,2,5);plot(imag(W2));
title('2-sided angle(W2)')
%-------------------------------------
w1 = ifft( W1 ) ; % Works fine
subplot(3,2,2); plot( w1);
title( ' w2 = ifft(W2); (2-sided) ' );
% --------------------------------------
% Use the /symmetric/ option of ifft() with
% the single-sided spectrum
w2 = ifft(W2 , 'symmetric'); % 1-sided, works fine
subplot(3,2,4);plot(w2,'k');
title( 'w2 = ifft(W2, "symmetric" )')
% --------------------------------------
% Calculate the complex-cojugate of 1-sided W2
% (excluding the zero frequency point?!), flip it,
% and attach it to the tail of W2 col vector.
H = flipud(conj(W2(2:n2)));
W3 = [W2 ; H];
w3 = ifft( W3 ) ; % sourse of my migraine headache
% If you let n =1000 instead of the 100, the effect of
% amplitude-modulation-like effect is less and the output
% (bottom right graph)resembles the input wavelet but
% with a thicker line.
% If n=100 and W2(1:n2-1) in H = ... is used instead
% of the W2(2:n2), you'll get a flying bold eagle!
subplot(3,2,6);plot(w3,'k');
title('w3 = ifft([W2 ; H]')
%---end of the program-------------------
【问题讨论】: