100% found this document useful (2 votes)
7K views9 pages

MATLAB Modulation Techniques

ANURAG ENGINEERING COLLEGE 1. Generation of Amplitude Modulation AIM: To perform the generation of Amplitude Modulation using MATLAB. Apparatus Required: A) Hardware Tools B) Software Tool Program: clc; close all; clear all; fc=100000; % Carrier frequency fs=1000000; % Sampling frequency f=1000; % Tone modulation m=0.5; % Modulation index A=1/m; % Amplitude of carrier signal opt=-A; t=0:1/fs:((2/f)-(1/fs)); % Gives exact two cycles of modulating signal x=cos(2*pi*f*t); y=modulate(x,fc,fs,'amdsb
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 DOCX, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
7K views9 pages

MATLAB Modulation Techniques

ANURAG ENGINEERING COLLEGE 1. Generation of Amplitude Modulation AIM: To perform the generation of Amplitude Modulation using MATLAB. Apparatus Required: A) Hardware Tools B) Software Tool Program: clc; close all; clear all; fc=100000; % Carrier frequency fs=1000000; % Sampling frequency f=1000; % Tone modulation m=0.5; % Modulation index A=1/m; % Amplitude of carrier signal opt=-A; t=0:1/fs:((2/f)-(1/fs)); % Gives exact two cycles of modulating signal x=cos(2*pi*f*t); y=modulate(x,fc,fs,'amdsb
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 DOCX, PDF, TXT or read online on Scribd

ANURAG ENGINEERING COLLEGE

1. Generation of Amplitude Modulation


AIM: To perform the generation of Amplitude Modulation using MATLAB. Apparatus Required: A) Hardware Tools B) Software Tool Program: clc; close all; clear all; fc=100000; % Carrier frequency fs=1000000; % Sampling frequency f=1000; % Tone modulation m=0.5; % Modulation index A=1/m; % Amplitude of carrier signal opt=-A; t=0:1/fs:((2/f)-(1/fs)); % Gives exact two cycles of modulating signal x=cos(2*pi*f*t); y=modulate(x,fc,fs,'amdsb-tc',opt); subplot(2,2,1); plot(x); title('modulating signal-time domain') % Modulating signal subplot(2,2,2); plot(y); title('DSB-C signal-time domain, m=0.5') % Under modulation m=1.0; opt=-1/m; y=modulate(x,fc,fs,'amdsb-tc',opt); subplot(2,2,3); plot(y); title('DSB-C signal-time domain, m=1.0') % Critical modulation m=1.2; opt=-1/m; y=modulate(x,fc,fs,'amdsb-tc',opt); subplot(2,2,4); plot(y); title('DSB-C signal-time domain, m=1.2') % Over modulation : : Computer system (Pentium IV) MATLAB 7.0 (Signal Processing Tool)

ANALOG COMMUNICTION LAB

Page 1

ANURAG ENGINEERING COLLEGE

2. Generation of Amplitude DSB-SC Modulation


AIM: To perform the generation of Amplitude DSB-SC Modulation using MATLAB. Apparatus Required: a)Hardware Tools : b)Software Tool : Program: clc; close all; clear all; fc=2000; % Carrier frequency fs=10000; % Sampling frequency f=200; % Single tone modulation t=0:1/fs:((2/f)-(1/fs)); x=cos(2*pi*f*t); y1 = modulate(x,fc,fs,'amdsb-sc'); f1 = abs(fft(y1, 1024)); f1 = [f1(514:1024) f1(1:513)]; f=(-511*fs/1024):(fs/1024):(512*fs/1024); subplot(1,2,1); plot(f,f1); title('DSB-SC spetrum for single tone modulation, f=200,fc=2000,fs=10000'); xlabel('FREQUENCY IN Hz'); ylabel('AMPLITUDE'); f1=200; f2=400; % Two tone modulation x2=cos(2*pi*f1*t)+cos(2*pi*f2*t) y2 = modulate(x2,fc,fs,'amdsb-sc'); f2 = abs(fft(y2, 1024)); f2 = [f2(514:1024) f2(1:513)]; subplot(1,2,2); plot(f,f2); title('DSB-SC spetrum for two tone modulation, f=200 & 400,fc=2000,fs=10000'); xlabel('FREQUENCY IN Hz'); ylabel('AMPLITUDE'); Computer system(Pentium IV) MATLAB 7.0 (Signal Processing Tool)

ANALOG COMMUNICTION LAB

Page 2

ANURAG ENGINEERING COLLEGE

3. Generation of Amplitude SSB-SC Modulation


AIM: To perform the generation of Amplitude SSB-SC Modulation using MATLAB. Apparatus Required: a)Hardware Tools : b)Software Tool : Program: clc; close all; clear all; fc=2000; % Carrier frequency fs=10000; % Sampling frequency f=200; % Single tone modulation t=0:1/fs:((2/f)-(1/fs)); x=cos(2*pi*f*t); y1 = modulate(x,fc,fs,'amssb'); f1 = abs(fft(y1, 1024)); f1 = [f1(514:1024) f1(1:513)]; f=(-511*fs/1024):(fs/1024):(512*fs/1024); subplot(1,2,1); plot(f,f1); title('SSB spetrum for single tone modulation, f=200,fc=2000,fs=10000'); xlabel('FREQUENCY IN Hz'); ylabel('AMPLITUDE'); f1=200; f2=400; % Two tone modulation x2=cos(2*pi*f1*t)+cos(2*pi*f2*t) y2 = modulate(x2,fc,fs,'amssb'); f2 = abs(fft(y2, 1024)); f2 = [f2(514:1024) f2(1:513)]; f=(-511*fs/1024):(fs/1024):(512*fs/1024); subplot(1,2,2); plot(f,f2); title('SSB spetrum for two tone modulation, f=200 & 400 ,fc=2000,fs=10000'); xlabel('FREQUENCY IN Hz'); ylabel('AMPLITUDE'); Computer system(Pentium IV) MATLAB 7.0 (Signal Processing Tool)

ANALOG COMMUNICTION LAB

Page 3

ANURAG ENGINEERING COLLEGE

4. Generation of Frequency Modulation


AIM: To perform the generation of Frequency Modulation using MATLAB. Apparatus Required: a)Hardware Tools : b)Software Tool : Program: clc; close all; clear all; fc=10000; % Carrier frequency fs=100000; % Sampling frequency f1=200;f2=500; t=0:1/fs:((2/f1)-(1/fs)); x1=cos(2*pi*f1*t); x2=cos(2*pi*f1*t)+cos(2*pi*f2*t); kf=2*pi*(fc/fs)*(1/max(max(x1))); kf=kf*(f1/fc); opt=10*kf; y1=modulate(x1,fc,fs,'fm',opt); subplot(2,2,1); plot(x1); title('original single tone message,fs=100000') subplot(2,2,2); plot(y1); title('time domain fm,singletone,fc=10000,fm=200,dev=10*fm') fx1=abs(fft(y1,1024)); fx1=[fx1(514:1024) fx1(1:513)]; f=(-511*fs/1024):(fs/1024):(512*fs/1024); subplot(2,2,3); plot(f,fx1); title('freq. description,single tone,dev=10*fm') x1_recov=demod(y1,fc,fs,'fm',opt); subplot(2,2,4); plot(x1_recov); title('time domain recovered,single tone,dev=30*fm') Computer system(Pentium IV) MATLAB 7.0 (Signal Processing Tool)

ANALOG COMMUNICTION LAB

Page 4

ANURAG ENGINEERING COLLEGE

5. Verification of Sampling Theorem


AIM: To perform and verification of sampling theorem using MATLAB. Apparatus Required: a)Hardware Tools : b)Software Tool : Program: clc; close all; clear all; % over sampling : fs > 2fm fm=100; fs=600; t=0:1/fs:((10/fm)-(1/fs)); x=sin(2*pi*fm*t); fx=fft(x,64); xr=ifft(fx,64); f=(-31*fs/64):(fs/64):(32*fs/64); fx=[fx(34:64) fx(1:33)]; subplot(231),stem(x),title('sampled signal, fm=100, fs=600'); subplot(232),stem(f,abs(fx)), axis([-300 300 0 30]); title('frequency spectrum, fm=100,fs=600'); subplot(233),stem(xr),title('recovered signal, fm=100, fs=600'); % under sampling : fs < 2fm fm=400; x=sin(2*pi*fm*t); fx=fft(x, 64); xr=ifft(fx,64); fx=[fx(34:64) fx(1:33)]; subplot(234),stem(x),title('sampled signal, fm=400, fs=600'); subplot(235),stem(f,abs(fx)), axis([-300 300 0 30]); title('frequency spectrum, fm=400,fs=600'); subplot(233),stem(xr),title('recovered signal, fm=400, fs=600'); Computer system(Pentium IV) MATLAB 7.0 (Signal Processing Tool)

ANALOG COMMUNICTION LAB

Page 5

ANURAG ENGINEERING COLLEGE

6. Generation of Time Division Multiplexing


AIM: To perform the generation of Time Division Multiplexing using MATLAB. Apparatus Required: a)Hardware Tools : b)Software Tool : Program: clc; close all; clear all; % Signal generation x=0:.5:4*pi; sig1=8*sin(x); l=length(sig1); sig2=8*triang(l); % Display of Both Signal subplot(2,3,1); plot(sig1); title('Sinusoidal Signal'); ylabel('Amplitude--->'); xlabel('Time--->'); subplot(2,3,2); plot(sig2); title('Triangular Signal'); ylabel('Amplitude--->'); xlabel('Time--->'); % Display of Both Sampled Signal subplot(2,3,3); stem(sig1); title('Sampled Sinusoidal Signal'); ylabel('Amplitude--->'); xlabel('Time--->'); subplot(2,3,4); stem(sig2); title('Sampled Triangular Signal'); ylabel('Amplitude--->'); xlabel('Time--->'); l1=length(sig1); l2=length(sig2); for i=1:l1
ANALOG COMMUNICTION LAB Page 6

Computer system(Pentium IV) MATLAB 7.0 (Signal Processing Tool)

% siganal taken upto 4pi % generate 1st sinusoidal signal % Generate 2nd traingular Sigal

ANURAG ENGINEERING COLLEGE

sig(1,i)=sig1(i); sig(2,i)=sig2(i); end

% Making Both row vector to a matrix

% TDM of both quantize signal tdmsig=reshape(sig,1,2*l1); % Display of TDM Signal figure stem(tdmsig); title('TDM Signal'); ylabel('Amplitude--->'); xlabel('Time--->'); % Demultiplexing of TDM Signal demux=reshape(tdmsig,2,l1); for i=1:l1 sig3(i)=demux(1,i); % Converting The matrix into row vectors sig4(i)=demux(2,i); end % display of demultiplexed signal figure subplot(2,1,1) plot(sig3); title('Recovered Sinusoidal Signal'); ylabel('Amplitude--->'); xlabel('Time--->'); subplot(2,1,2) plot(sig4); title('Recovered Triangular Signal'); ylabel('Amplitude--->'); xlabel('Time--->');

ANALOG COMMUNICTION LAB

Page 7

ANURAG ENGINEERING COLLEGE

7. Pulse Width Modulation & Demodulation


AIM: To perform Pulse Width Modulation & Demodulation using MATLAB. Apparatus Required: a)Hardware Tools : b)Software Tool : Program: clc; close all; clear all; fc=1000; % Carrier frequency fs=10000; % Sampling frequency f1=200; % Single tone modulation t=0:1/fs:((2/f1)-(1/fs)); x1=0.4*cos(2*pi*f1*t)+0.5; %single tone message to be [0,1] y1=modulate(x1,fc,fs,'pwm'); subplot(3,1,1); plot(x1); title(' single tone message, f1=200,fs=10000'); subplot(3,1,2); plot(y1); axis([0 500 -0.2 1.2]); title('pwm, one cycle of f1, fc=1000,f1=200'); x1_recov=demod(y1,fc,fs,'pwm'); subplot(3,1,3); plot(x1_recov); title('time domain recovered,single tone, f1=200'); Computer system(Pentium IV) MATLAB 7.0 (Signal Processing Tool)

ANALOG COMMUNICTION LAB

Page 8

ANURAG ENGINEERING COLLEGE

8. Pulse Position Modulation & Demodulation


AIM: To perform Pulse Position Modulation & Demodulation using MATLAB. Apparatus Required: a)Hardware Tools : b)Software Tool : Program: clc; close all; clear all; fc=1000; % Carrier frequency fs=10000; % Sampling frequency f1=200; % Single tone modulation t=0:1/fs:((2/f1)-(1/fs)); x1=0.4*cos(2*pi*f1*t)+0.5; %single tone message to be [0,1] y1=modulate(x1,fc,fs,'ppm'); subplot(2,2,1); plot(x1); title(' single tone message, f1=200,fs=10000'); subplot(2,2,2); plot(y1); axis([0 500 -0.2 1.2]); title('ppm, one cycle of f1, fc=1000,f1=200'); x1_recov=demod(y1,fc,fs,'ppm'); subplot(2,2,3); plot(x1_recov); title('time domain recovered,single tone, f1=200'); Computer system(Pentium IV) MATLAB 7.0 (Signal Processing Tool)

ANALOG COMMUNICTION LAB

Page 9

You might also like