0% found this document useful (0 votes)
17 views2 pages

Lab No. 7

The lab report from COMSATS University Islamabad focuses on sampling a sinusoid wave with two frequency components, f1 = 3kHz and f2 = 5kHz, using a sampling frequency of fs = 12kHz. The report includes source code for generating the wave and calculating its FFT, along with a plot that indicates whether aliasing occurs. The output figure illustrates the frequency components and their amplitudes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views2 pages

Lab No. 7

The lab report from COMSATS University Islamabad focuses on sampling a sinusoid wave with two frequency components, f1 = 3kHz and f2 = 5kHz, using a sampling frequency of fs = 12kHz. The report includes source code for generating the wave and calculating its FFT, along with a plot that indicates whether aliasing occurs. The output figure illustrates the frequency components and their amplitudes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

COMSATS UNIVERSITY ISLAMABAD

ATTOCK CAMPUS

LAB REPORT

Digital Signal Processing

Abdul Wahab
Group Members FA21-BEE-004

Muhammad Zaheer ud din


FA21-BEE-011

LAB Instructor: Dr. Mubashir Rehman


LAB NO.7
Sampling

Task No.1:
Use your ‘sin’ or ‘cos’ function to generate a sinusoid wave having two
components as f1 = 3kHz and f2 = 5kHz and then sample it with fs = 12kHz.
Calculate its fft with zero frequency component in the middle. Plot it on a properly
scaled w-axis. Specify if there is aliasing or not? If there is aliasing specify which
component is casing the aliasing.

S O U R C E C O D E
n = -50:50;
f1 = 3000; f2=5000;
fs = 12000;
x = sin(2*pi*(f1/fs)*n)+sin(2*pi*(f2/fs)*n) ;
subplot(2,1,1);
stem(n,x);
L = length(x);
NFFT = 2^nextpow2(L);
y = fft(x,NFFT);
f_ax1 = fs/2*linspace(0,1,NFFT/2+1);
f_ax2 = fs/2*linspace(-1,0,NFFT/2-1);
f_ax = [f_ax1 f_ax2];
stem(f_ax,2*abs(y));

O U T P U T:
120

100

80

60

40

20

0
-6000 -4000 -2000 0 2000 4000 6000
Figure 1

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy