Documente Academic
Documente Profesional
Documente Cultură
Date:
VBIT Page 1
AC & DC
Date:
List of experiments
1. 2. 3. 4. 5.
Amplitude Modulation and Demodulation Frequency Modulation and Demodulation Double side band suppressed carrier Modulation and Demodulation Pulse Width Modulation and Demodulation Pulse Position Modulation and Demodulation
VBIT Page 2
AC & DC
Date:
AC & DC
Date:
Procedure:
1. Open the matlab command & editor windows 2. Write the program 3. Save the program 4. Go to debug and run it 5. You can observe the output on the command window.
Program:
t0=0.15; f=1/0.15; ts=0.001; fc=250; fs=1/ts; t=[0:ts:t0]; a=0.85; df=0.5; %gen of msg signal m1=sin(2*pi*2*f*t); figure(1) subplot(3,1,1); plot(t,m1); n=length(m); grid on xlabel('time'); ylabel('magnitude'); title('message signal'); ylim([-1.1 1.1]); %gen of carrier signal c=cos(2*pi*fc.*t); subplot(3,1,2); plot(t,c); title('carrier signal'); xlabel('time'); %gen of modulated signal and spectrum [M,m,df1]=fftseq(m,ts,df); M=M/fs; f=[0:df1:df1*length(m)-1]-fs/2; u=(1+a*m); u=u(1:151).*c; subplot(3,1,3); plot(t,u); VBIT Page 4
AC & DC xlabel('time'); title('modulated signal'); ylim([-1.2 1.2]); %gen of frequency spectrum of message signal [U,u,df1]=fftseq(u,ts,df); U=U/fs; %frequency spectrum of message signal figure(2) subplot(1,2,1); plot(f,abs(fftshift(M))); xlabel('frequency'); title('spectrum of message signal'); subplot(1,2,2); plot(f,abs(fftshift(U))); xlabel('frequency'); title('spectrum of modulated signal');
Date:
Simulation Responses:
Result: Hence Amplitude Modulation and Demodulation performed and the simulation responses has been observed and verified.
VBIT Page 5
AC & DC
Date:
AC & DC
Date:
Procedure:
1. Open the matlab command & editor windows 2. Write the program 3. Save the program 4. Go to debug and run it 5. You can observe the output on the command window.
Program:
% t0=0.15; ts=0.001; f=10; fc=200; kf=50; fs=1/ts; t=[0:ts:t0]; df=0.25; % %Message signal m=sin(2*3.14*2*f*t); %plot of the msg signal subplot (2,2,1); plot(t,m); grid on; ylim([-1.1 1.1]); xlabel('time'); ylabel('x(t)'); title('message signal'); %integral of m int_m(1)=0; for i= 1:length(t)-1; int_m(i+1)=int_m(i)+m(i)*ts; end %finding the fourier transform of m signal [M,m,df1]=fftseq(m,ts,df); M=M/fs; f=[0:df1:df1*(length(m)-1)]-fs/2; %generation of modulated signal u=cos(2*3.14*fc*t+2*3.14*kf*int_m); subplot(2,2,2); VBIT Page 7
AC & DC plot(t,u(1:length(t))); xlabel('time'); title('modulated signal'); % %finding the fourier transform of the modulated signal u % [U,u,df1]=fftseq(u,ts,df); U=U/fs; %plots magnitude of message and modulated signal in frequency domain length(f); length(M); length(U); subplot(2,2,3); plot(f,abs(fftshift(M))); xlabel('frequency'); title('spectrum of message signal'); grid on; subplot(2,2,4); plot(f,abs(fftshift(U))); xlabel('Frequency'); title('spectrum of modulated signal'); grid on;
Date:
Simulation Responses:
Result: Hence Frequency Modulation and Demodulation responses has been observed and verified. VBIT
Page 8
AC & DC
Date:
Aim: Write a program to perform Double side band suppressed carrier Modulation and
Demodulation by using MAT lab and check the simulation responses.
AC & DC
Date:
Procedure:
1. Open the matlab command & editor windows 2. Write the program 3. Save the program 4. Goto debug and run it 5. You can observe the waveforms on the command window.
Program:
clc clear all close all %input fm=1000; wm=2*3.14*fm; t=0:0.000000001:1.5/fm; m=sin(wm*t); subplot(2,2,1); plot(t,m); title('input signal'); xlabel('time'); ylabel('amplitude'); %carrier fc=10000; wc=2*3.14*fc; c=sin(wc*t); subplot(2,2,2); plot(t,c); title('carriersignal'); xlabel('time'); ylabel('amplitude'); %dsbsc au=c.*m; subplot(2,2,3); plot(t,au); title('dsbsc signal'); xlabel('time'); ylabel('amplitude'); %demod d=c.*au; subplot(2,2,4); plot(t,d); VBIT Page 10
Date:
Simulation Responses:
Result: Hence Double side band suppressed carrier Modulation and Demodulation performed
and the simulation responses has been observed and verified.
VBIT Page 11
AC & DC
Date:
AC & DC
Date:
Procedure:
1. Open the matlab command & editor windows 2. Write the program 3. Save the program 4. Go to debug and run it 5. You can observe the output on the command window.
Program:
% clc Fc=100; Fs=4000; ts=1/Fs; t=[0:ts:1/Fc]; size(t); % %generation of message wave % figure(1) subplot(2,1,1) x=0.5+0.4*sin(2*3.14*Fc*t);%message or modulating signal plot(t,x); grid on ylabel('amplitude'); xlabel('time(in secs)'); title('modulating/message signal'); % %generation of pulse carrier % tt=(-4/1000:(ts/10):6/1000); m=zeros(size(tt)); m(1:40)=ones(size(m(1:40))); m(81:120)=ones(size(m(81:120))); m(161:200)=ones(size(m(161:200))); m(241:280)=ones(size(m(241:280))); VBIT Page 13
AC & DC m(321:360)=ones(size(m(321:360))); subplot(2,1,2); plot(tt,m); ylim([0 1.2]); ylabel('amplitude'); xlabel('time(in mill secs)'); title('pulse carrier signal'); % %generation of PWM % y=modulate(x,Fc,Fs,'pwm','centered'); k=1:1:length(y);
Date:
k=k/(length(y)*100); figure(2); subplot(2,2,2); plot(k,y); title('modulated signal'); ylim ([0 1.2]); subplot(2,2,1); plot(t,x); grid on; ylabel('amplitude'); xlabel('time(in secs)'); title('modulating/message signal'); %demod signal of modulated signal m1=demod(y,Fc,Fs,'pwm','centered'); subplot(2,2,3); plot(t,m1); title('PWM demodulated signal'); grid on; % Sx=fftshift(abs(fft(y)))% power spectrum of PWM f=-length(Sx)/2:1:(length(Sx-1)/2)-1; subplot(2,2,4); plot(f,Sx); grid; title('magnitude spectrum of x(n)'); xlabel('frequency,Hz'); ylabel('Magnitude,Db'); %
VBIT Page 14
AC & DC
Date:
Simulation Responses:
Result: Hence Pulse Width Modulation and Demodulation performed and the simulation
responses has been observed and verified.
VBIT Page 15
AC & DC
Date:
AC & DC
Date:
Procedure:
Open the matlab command & editor windows Write the program Save the program Go to debug and run it You can observe the output on the command window.
Program:
% clc Fc=100; Fs=4000; ts=1/Fs; t=[0:ts:1/Fc]; size(t); % %generation of message wave % figure(1) subplot(2,1,1) x=0.5+0.4*sin(2*3.14*Fc*t);%message or modulating signal plot(t,x); grid on ylabel('amplitude'); xlabel('time(in secs)'); title('modulating/message signal'); % %generation of pulse carrier % tt=(-4/1000:(ts/10):6/1000); m=zeros(size(tt)); m(1:40)=ones(size(m(1:40))); m(81:120)=ones(size(m(81:120))); m(161:200)=ones(size(m(161:200))); m(241:280)=ones(size(m(241:280))); m(321:360)=ones(size(m(321:360))); subplot(2,1,2); VBIT Page 17
AC & DC plot(tt,m); ylim([0 1.2]); ylabel('amplitude'); xlabel('time(in mill secs)'); title('pulse carrier signal'); % %generation of PPM % k=1:1:length(Sx); k=k/(length(Sx)*100); y1=modulate(x,Fc,Fs,'ppm'); figure(3); subplot(2,2,2); plot(k,y1); title(' pulse position modulated signal'); ylim ([0 1.2]); subplot(2,2,1); plot(t,x); grid on; ylabel('amplitude'); xlabel('time(in secs)'); title('modulating/message signal'); % %demod signal of pulse position modulated signal m2=demod(y1,Fc,Fs,'ppm'); subplot(2,2,3); plot(t,m2); title('PPM demodulated signal'); grid on; %Spectrum of ppm Sx1=fftshift(abs(fft(y1)))% power spectrum of PPM f=-length(Sx1)/2:1:(length(Sx1-1)/2)-1; subplot(2,2,4); plot(f,Sx1); grid on; title('magnitude spectrum of x(n)'); xlabel('frequency,Hz'); ylabel('Magnitude,Db'); %
Date:
VBIT Page 18
AC & DC
Date:
Simulation Responses:
Result: Hence Pulse Position Modulation and Demodulation performed and the simulation
responses has been observed and verified. VBIT Page 19