Digital Signal Processing Reference
In-Depth Information
f(t) outside of its support. For a discrete signal, the number of points for the
frequency-domain signal equals the number of points in the time-domain signal, so
adding zeros means that there will be more frequency-domain points. The analysis
frequencies, as a result, become ner since they are closer together.
6.5
DFT Shifting Theory
There is a DFT shifting theory, stating that sampling a signal will give the same
results (in terms of frequency magnitude response), even when the samples are
shifted, such as removing the rst k samples and appending them to the end of
the sample sequence. This is an important theory, since it tells us that there is no
critical time to start recording samples. The program below demonstrates this idea.
Notice how the plot command puts two signals on the graph at the same time, one
in blue ('b') and the other in green ('g'). Try other colors like red ('r') and black
('k').
% Demonstrate DFT Shifting theory
%
% parameters to modify
number_of_samples = 16;
shift = 3;
% Must be less than number_of_samples
fs = 2000;
% sampling frequency
% Make our example signal
Ts = 1/fs;
range = 1:number_of_samples;
x(range) = 2*cos(2*pi*400*(range-1)*Ts) ...
+ cos(2*pi*700*(range-1)*Ts);
% Make y a shifted version of x
y = [x(shift:number_of_samples), x(1:shift-1)];
% Get fft of each signal
X = fft(x);
Y = fft(y);
% Find magnitudes
Search WWH ::




Custom Search