ASN11 - Leakage demonstration in Octave: Difference between revisions

From Class Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Jodi Hodge|Back to my home page]]
[[Jodi Hodge|Back to my home page]]


Leakage occurs when the Discrete Fourier Transform (DFT) is applied to a signal whose range is not a multiple of the total period.
Leakage occurs when the Discrete Fourier Transform (DFT) is applied to a signal whose range is not a multiple of the total period. The DFT function assumes that the signal is periodic it when it repeats the function should be periodic. If the sample range is not a multiple of the period them when the DFT repeat the function will have disctonuity at the restarting point.
The DFT function assumes that the signal is periodic.






example octave script no leakage
Example octave script no leakage


fs=1500
fs=1500


t=[1:20]/fs; %is multiple of the period 1/fs
t=[1:20]/fs;

y=sin(2*pi*t);
y=sin(2*pi*t);


x= dft(y,t); %function x is continous
x= dft(y);






example octave script no leakage
Example octave script with leakage


fs=1500
fs=1500


t=[1:20]/500; %does not include whole periods
t=[1:20]/fs;


y=sin(2*pi*t);
y=sin(2*pi*t);


x= dft(y,t); %function x is not continuous and demonstrates leakage
x= dft(y);

Latest revision as of 16:21, 21 December 2009

Back to my home page

Leakage occurs when the Discrete Fourier Transform (DFT) is applied to a signal whose range is not a multiple of the total period. The DFT function assumes that the signal is periodic it when it repeats the function should be periodic. If the sample range is not a multiple of the period them when the DFT repeat the function will have disctonuity at the restarting point.


Example octave script no leakage

fs=1500

t=[1:20]/fs; %is multiple of the period 1/fs

y=sin(2*pi*t);

x= dft(y,t); %function x is continous



Example octave script with leakage

fs=1500

t=[1:20]/500; %does not include whole periods

y=sin(2*pi*t);

x= dft(y,t); %function x is not continuous and demonstrates leakage