DSPRelated.com
Forums

Zoom FFT - RESAMPLING HELP

Started by hide_xjapan2003 August 25, 2008
dear everyone,

i need some help about Zoom FFT.
i've read some literature about this from B&K but there is one
question
that make me stuck when perform this.

from the literature ,the final step for accomplish this method is
RESAMPLING.

i've try to simulate the ZOOM FFT based on sinusoidal signal, but i
dont understand in the last step, RESAMPLING. if you try this code
its work, BUT if we imagine that we take the real data from
measurement, we have ONLY limited amount data (due to discretization
in ADC) after first sampling (like in this code, fs = 256 Hz), so we
ONLY can play with 512 data in time domain.

BUT how can we perform resampling method by "Oversampled the data by
M factor while we have ONLY discrete data based on previous sampling?"

I'm not sure about this code either it is true or not, is there
someone who can help me to explain this ?????

%----------------------PARAMETER ADJUST-------------------------------
Nf = 200; %CHOOSE frequency line
fmax = 100; %CHOOSE max frequency
fp = 50; %CHOOSE shifting frequency
M = 2; %CHOOSE zoom factor
fmaxn= fmax/M+fp; %CHOOSE new max frequency

%----------------------SAMPLING---
fs = 2.56*fmax; %compute sampling freq.
dt = 1/fs; %compute time increment
Nt = 2.56*Nf; %compute total time domain
data
T = 0:dt:(dt*(Nt-1)); %time range

x = 1*sin(2*pi*60.5*T)+1*sin(2*pi*60*T); %function

df = fmax/Nf; %compute frequency increment
y = fft(x,Nt); %compute FFT
mag = (2*abs(y))/Nt; %compute magnitude
freq = 0:df:(fmax-df); %frequency range

subplot(211);
plot(freq,mag(1:Nf))
title('Frequency Domain Signal')
xlabel('Frequency [Hz]')
ylabel('Amplitude [mm]')

%----------------------HETERODYNE & DIGITAL LPF-----------------------
k = x.*exp(-j*2*pi*fp.*T); %shifting signal
fc = fmaxn;
Wp = (fc/(fs/2)); %define cut-off frequency
[b,a]= butter(2,Wp,'low');
w = filter(b,a,k); %filter the time domain

%----------------------RESAMPLING-
dfn = df/M; %compute new frequency inc.
Ntn = Nt*M; %compute new time dom. data

yn = fft(w,Ntn); %compute FFT
magn = (2*abs(yn))/Nt; %compute new magnitude
freqn= fp:dfn:(fmaxn-dfn); %frequency range

subplot(212);
plot(freqn,magn(1:length(freqn)))
title('Frequency Domain Signal After Zoom Process')
xlabel('Frequency [Hz]')
ylabel('Amplitude [mm]')
%---------------------------------