IFFT, resampling, complex conjugate symmetry, zero padding, interpolation, aliasing, oscillation
이전 댓글 표시
Hello, I have measurements (complex values) in the frequency domain, from 20 MHz to 20 GHz. I would like to convert them into time domain using IFFT. My Data has three columns, the first column is frequency (20000000, 32487500, 44975000, ...,2e10), 1601 points and the second and third columns are corresponding real and imaginary data. Size of matrix is (1601 x 3)

Here is my code.
%% uniform sampling in time domain
OT = 1./Data_mix(:,1); % original time
OF = Data_mix(:,1); % original Frequency
NT = flipud(linspace(OT(end,1), OT(1,1), 1000)'); % new time in uniform spacing
NT = [NT; 0]; % 1001 x 1
T = NT(2)-NT(3); % dt, 1.952e-12
FS = 1/T; % need to be at least twice the maximum frequency ?
N = size(NT,1); % 1001
df = FS/N; % Frequency increment
f = [0 : df : FS-df]'; % 1001 x 1
c_ust = 1;
Data_R = interp1(OF, Data_mix(:,2), f,'nearest','extrap'); % real
Data_I = interp1(OF, Data_mix(:,3), f,'nearest','extrap'); % imag
Data_ust = Data_R + 1j*Data_I; % Data with uniform sampling time 1001
%% making complex conjugate symmetry
Data_cc = [real(Data_ust(1,1)); Data_ust(2:end-1,1); real(Data_ust(end,1)); conj(Data_ust(end-1:-1:2,1))]; % complex conjugate symmetric data

%% interpolation in time domain
IF = 16; % interpolation factor (2, 4, 8, 16, or 32...)
Ncc = 2*N-2; % 2000
fcc = df*(0:Ncc-1)'; % frequency points
MM = IF*Ncc; % interpolation factor
dt1 = T/MM;
t1 = dt1*(0:MM-1)'; % time points after interpolation 2000 * 16 = 32000
f1 = df*(0:MM-1)'; % frequency points after interpolation 2000 * 16 = 32000
%% zero-paddings
if mod(Ncc,2)==0 % N even
Data_zp = [Data_cc(1:Ncc/2,1); 0.5*Data_cc(1+Ncc/2,1); zeros(MM-Ncc-1,1);
0.5*Data_cc(1+Ncc/2,1); Data_cc(2+Ncc/2:Ncc,1)];
else % N odd
Data_zp = [Data_cc(1:(Ncc+1)/2,1); zeros(MM-Ncc,1); Data_cc((Ncc+3)/2:Ncc,1)];
end

%% IFFT
Data_TD = (MM/Ncc)*ifft(Data_zp);
figure, plot(t1, Data_TD,'o-'); grid on; xlim([0 5e-13]);
The result shows like this, which has unwanted oscillation. Please teach me what is wrong. Thank you!

댓글 수: 3
Santhana Raj
2017년 5월 17일
WHat about the actual sampling frequency of the data captured? You have used dt=1.952e-12. But is this the same sampling frequency of the captured data?
I think the sampling frequency should be
(Data_mix(1,1)-Data_mix(2,1))*1601.
This is assuming the N(1601) to be the same as the no of points in the FFT done in the captured data.
Hyungjoo Lee
2017년 5월 17일
Hyungjoo Lee
2017년 6월 1일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Correlation and Convolution에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!