0% found this document useful (0 votes)
30 views4 pages

Digital Signal Processing Practical 1

Experiment 1 Sampling & Aliasing Program 1: Sampling of a Signal clc; clear all; close all; F = input('Enter Modulating Frequency Fm : '); Fs = input('Enter Sampling Frequency Fs : '); t = 0 : (1/(100*F)) : (2/F) ; X = sin(2*pi*F*t); n = 0 : 1 : (floor((2*Fs)/F))-1; Xs= sin(2*pi*(F/Fs)*n); subplot(2,1,1); plot(t,X); title('Continuous time signal' ); xlabel('Time t'); ylabel('Amplitude of signal'); subplot(2,1,2); stem(n,Xs); title('Discrete time signal' ); xlabel('Time n'); ylabel('Amplitude of

Uploaded by

Atit Patel
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views4 pages

Digital Signal Processing Practical 1

Experiment 1 Sampling & Aliasing Program 1: Sampling of a Signal clc; clear all; close all; F = input('Enter Modulating Frequency Fm : '); Fs = input('Enter Sampling Frequency Fs : '); t = 0 : (1/(100*F)) : (2/F) ; X = sin(2*pi*F*t); n = 0 : 1 : (floor((2*Fs)/F))-1; Xs= sin(2*pi*(F/Fs)*n); subplot(2,1,1); plot(t,X); title('Continuous time signal' ); xlabel('Time t'); ylabel('Amplitude of signal'); subplot(2,1,2); stem(n,Xs); title('Discrete time signal' ); xlabel('Time n'); ylabel('Amplitude of

Uploaded by

Atit Patel
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

Experiment 1

Sampling & Aliasing


Program 1: Sampling of a Signal clc; clear all; close all; F = input('Enter Modulating Frequency Fm : '); Fs = input('Enter Sampling Frequency Fs : '); t = 0 : (1/(100*F)) : (2/F) ; X = sin(2*pi*F*t); n = 0 : 1 : (floor((2*Fs)/F))-1; Xs= sin(2*pi*(F/Fs)*n); subplot(2,1,1); plot(t,X); title('Continuous time signal' ); xlabel('Time t'); ylabel('Amplitude of signal'); subplot(2,1,2); stem(n,Xs); title('Discrete time signal' ); xlabel('Time n'); ylabel('Amplitude of signal');

DIGITAL SIGNAL PROCESSING 7 SEMESTER ELECTRONICS & COMMUNICATION DIVISION : CX/C3 ROLL NO. :- 65 ATMIYA INSTITUTE OF TECHNOLOGY & SCIENCE, RAJKOT.
TH

Experiment 1

Sampling & Aliasing


Output: Enter Modulating Frequency Fm: 200 Enter Sampling Frequency Fs: 5000
Continuous time signal 1 Amplitude of signal 0.5 0 -0.5 -1

0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 Time t Discrete time signal

0.01

1 Amplitude of signal 0.5 0 -0.5 -1

10

15

20

25 Time n

30

35

40

45

50

DIGITAL SIGNAL PROCESSING 7 SEMESTER ELECTRONICS & COMMUNICATION DIVISION : CX/C3 ROLL NO. :- 65 ATMIYA INSTITUTE OF TECHNOLOGY & SCIENCE, RAJKOT.
TH

Experiment 1

Sampling & Aliasing


Program 2: To observe aliasing effect in metlab. clc; clear all; close all; F1 = input('Enter Modulating Frequency Fm1 : 1: '); F2 = input('Enter Modulating Frequency Fm2 : 2: '); Fs = input('Enter Sampling Frequency Fs : '); t = 0 : (1/(100*F2)) : (2/F1) ; X1 = sin(2*pi*F1*t); X2 = sin(2*pi*F2*t); n = 0 : 1 : (floor((2*Fs)/F1))-1; Xs1= sin(2*pi*(F1/Fs)*n); Xs2= sin(2*pi*(F2/Fs)*n); subplot(2,2,1); plot(t,X1); title('Continuous time signal of Fm1' ); xlabel('Time t'); ylabel('Amplitude of signal'); subplot(2,2,2); stem(n,Xs1); title('Discrete time signal of Fm1' ); xlabel('Time n'); ylabel('Amplitude of signal'); subplot(2,2,3); plot(t,X2); title('Continuous time signal of Fm2' ); xlabel('Time t'); ylabel('Amplitude of signal');

DIGITAL SIGNAL PROCESSING 7 SEMESTER ELECTRONICS & COMMUNICATION DIVISION : CX/C3 ROLL NO. :- 65 ATMIYA INSTITUTE OF TECHNOLOGY & SCIENCE, RAJKOT.
TH

Experiment 1

Sampling & Aliasing


subplot(2,2,4); stem(n,Xs2); title('Discrete time signal of Fm2' ); xlabel('Time n'); ylabel('Amplitude of signal');

Output: Enter Modulating Frequency Fm1 : 300 Enter Modulating Frequency Fm2 : 1000 Enter Sampling Frequency Fs : 700
Continuous time signal of Fm1 1 Amplitude of signal 0.5 0 -0.5 -1 Amplitude of signal 1 0.5 0 -0.5 -1 Discrete time signal of Fm1

x 10 Continuous time signal of Fm2 1 Amplitude of signal 0.5 0 -0.5 -1

4 Time t

8
-3

1 Time n

Discrete time signal of Fm2 1 Amplitude of signal 0.5 0 -0.5 -1

4 Time t

6 x 10

8
-3

1 Time n

DIGITAL SIGNAL PROCESSING 7 SEMESTER ELECTRONICS & COMMUNICATION DIVISION : CX/C3 ROLL NO. :- 65 ATMIYA INSTITUTE OF TECHNOLOGY & SCIENCE, RAJKOT.
TH

You might also like