Docsity

Aliasing - Digital Signal Processing - Lab Manual, Study notes of Computer Fundamentals

Toggle sidebar
bg1
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 (28) 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.
Docsity.com
pf3

Partial preview of the text

Download Aliasing - Digital Signal Processing - Lab Manual and more Study notes Computer Fundamentals in PDF only on Docsity!

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.

  1. Repeat part(I) with the frequency 7000hz.
  2. Are the graphs the same?
  3. Can you explain the reason?
  4. Which plot shows the effect of aliasing?
  5. How can you tell?

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:

  1. Does the pitch of the tone that you hear increase with each increase in the frequency Q 0?
  2. If not, can you explain this behavior?

As an example, we introduce the “chirp” phenomena where the instantaneous frequency of some special signal will increase over time. Consider the signal

2

x ( t ) sin ω ot β t

For Question 3, set ω o = 2 π (3000) rad/sec and β = 2000 rad/sec^2.