Professional Documents
Culture Documents
Lab01 4
Lab01 4
: Experiment 1 :
1kHZ sine wave freq. Sampling freq. 8HZ 2kHZ sine wave freq. Sampling freq. 8HZ
1kHZ sine wave freq. Sampling freq. 8HZ 2kHZ sine wave freq. Sampling freq. 8HZ
Flat top :
1kHZ sine wave freq. Sampling freq. 8HZ 2kHZ sine wave freq. Sampling freq. 8HZ
: Experiment 2 :
1kHZ sine wave freq. Sampling freq. 8HZ 2kHZ sine wave freq. Sampling freq. 8HZ
1kHZ sine wave freq. Sampling freq. 8HZ 2kHZ sine wave freq. Sampling freq. 8HZ
Flat top :
1kHZ sine wave freq. Sampling freq. 8HZ 2kHZ sine wave freq. Sampling freq. 8HZ
: 4th Order Low pass Filter :
1kHZ sine wave freq. Sampling freq. 8HZ 2kHZ sine wave freq. Sampling freq. 8HZ
1kHZ sine wave freq. Sampling freq. 8HZ 2kHZ sine wave freq. Sampling freq. 8HZ
Flat top :
1kHZ sine wave freq. Sampling freq. 8HZ 2kHZ sine wave freq. Sampling freq. 8HZ
Experiment 4:
%N t=Nmin;
signal_freqdomain_centered = tshift(signal_freqdomain);
%set of frequencies for which Fourier transform has been computed using DFT
plot(freqs,abs(signal_freqdomain_centered));
xlabel(’Frequency’);
ylabel(’Magnitude Spectrum’);
ff
ff
ff
ff
ffi
ff
ff
ff
ff
ff
ff
ff
ff
ff
4(a) Use the function contFT to compute the Fourier transform of s(t) = 3sinc(2t − 3),
where the unit of time is a microsecond, the signal is sampled at the rate of 16 MHz, and
truncated to the range [−8, 8] microseconds. We wish to attain a frequency resolution of 1
KHz or better. Plot the magnitude of the Fourier transform versus frequency, making sure
you specify the units on the frequency axis. Check that the plot conforms to your
expectations.
clear all;
close all;
clc;
t=10^(-6);
dt = (1/16)*t;
time_int=-8*t:dt:8*t;
x = 3.*sinc(2*time_int-3);
tstart = -8*t;
df_desired = 1000; contFT(x,tstart,dt,df_desired);
function [X,f,df] = contFT(x,tstart,dt,df_desired)
Nmin=max(ceil(1/(df_desired*dt)),length(x));
Nfft = 2^(nextpow2(Nmin)); X=dt*fftshift(fft(x,Nfft));
df=1/(Nfft*dt);
f = ((0:Nfft-1)-Nfft/2)*df; X=X.*exp(-j*2*pi*f*tstart);
figure(1);
plot(f,abs(X));
xlabel('Fourier Transform Magnitude'); ylabel('Frequency in hz');
end
(b) Plot the phase of the Fourier transform obtained in (a) versus frequency (again,
make sure the units on the frequency axis are speci ed). What is the range of
frequencies over which the phase plot has meaning?
clear all;
close all;
clc;
t=10^(-6);
dt = (1/16)*t;
time_int=-8*t:dt:8*t;
x = 3.*sinc(2*time_int-3) ;
tstart = -8*t;
df_desired = 1000; contFT(x,tstart,dt,df_desired);
function [X,f,df] = contFT(x,tstart,dt,df_desired)
Nmin=max(ceil(1/(df_desired*dt)),length(x));
Nfft = 2^(nextpow2(Nmin)); X=dt*fftshift(fft(x,Nfft));
df=1/(Nfft*dt);
f = ((0:Nfft-1)-Nfft/2)*df; X=X.*exp(-j*2*pi*f*tstart);
plot(f,angle(X));
xlabel('Fourier Transform');
ylabel('Frequency in hz');
end
fi