| |
n = 64 ` number of points
tm = 2 ` max. time in seconds
dt = tm/n ` time interval
` the time array
t = 0 to tm-dt len n
` the frequency array in Hz (used in the graphs)
n2 = n/2
f = (-n2 to n2-1)/tm
k = 5 ` signal frequency (Hz)
dc = 0.2 ` dc level
h1 = dc + sin(2*pi*k*t) ` first signal
H1 = abs(ffts(h1)) ` fft with shift
h2 = h1 + 0.7*sin(2*pi*(k+3)*t) ` second signal
H2 = abs(ffts(h2)) ` fft with shift
` We now modulate the sine by a decaying exponent
a = 3
hh = sin(2*pi*k*t)*exp(-a*t) ` modulated signal
HH = abs(ffts(hh)) ` fft with shift
|
|
|