

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Aliasing
OBJECTIVE:
To investigate sampling of continuous-time signals and the effects of aliasing. This lab covers sampling and aliasing due to undersampling.
SECTION 1 SAMPLING AND ALIASING EFFECT
If the continuous-time sinusoidal signal
x(t)=sin(ωot).
is sampled with the frequency ωs=2πfs, then the discrete-time signal x[n] = x(nTs) is given by
x[n]=sin(ωonTs).
Assume that the sampling frequency is fixed at 8000Hz.
Question 1:
I. Oversampling.
a. Using MATLAB, create a sinusoidal signal with the frequency 1000 Hz. b. Sample it at 8000 Hz and collect 512 (2^8 ) samples. c. Using a subplot with 2 rows and 2 columns, plot the waveform in the subplot on the first row and first column. d. Set the axis so that you get three waves. e. Convert from the time domain to frequency domain by taking the Fourier Transform. f. Plot the FFT vs. frequency.
f=1000; %frequency of the sine wave fs=8000; %sampling frequency Ts=1/fs; %sampling time Ns=512; %512 points t= [0:Ts:Ts(Ns-1)]; %50/8000~6.25ms x=sin(2pift); %sine function for 50 samples subplot(2,2,1),plot(t,x) grid on; %plot of the sine wave axis([0,.003,-1.2,1.2]) %set the x,y axis X=(abs(fft(x,Ns))); %take the FFT y=X(1:length(X)/2); f=(1:length(y)); subplot(2,1,2),plot(f*fs/Ns,y); grid on;
II. Undersampling.
SECTION 2 USING sound( ) TO DEMONSTRATE THE ALlASING EFFECT
MATLAB has a function sound() that can convert a discrete signal sequence into continuous- time sounds. We can use it to demonstrate the effect of aliasing very easily.
Use the method in Question 1 to construct sinusoidal signals with the frequencies 1000Hz, 2000Hz, 3000Hz. 40001Hz, 5000Hz and 6000Hz respectively. Then use the command sound(x,fs) to “play” these sequences one by one, where x is the sequence and fs is defined as 8192 Hz. Listen to the pitch of the tone every time carefully.
Question 2:
As an example, we introduce the “chirp” phenomena where the instantaneous frequency of some special signal will increase over time. Consider the signal
2