Modulation and Demodulation in MATLAB - Matlab Simulink for E & T

# Modulation and Demodulation Techniques in MATLAB -

## Phase Modulation and Demodulation -

### Matlab Program -

%  PHASE MODULATION      %        AND DEMODULATION

clc ;
clear
all ;
close
all ;

t = 0 : 10e-7 : 0.001 ;

%  SIGNAL PARAMETERS  %

% Freq. of message signal in Hz
% Y = PMMOD(X,Fc,Fs,PHASEDEV)
fm_sign = 1e3 ;
fc_sign = 20e6 ;
% Frequency. of carrier signal in Hz
fsamp = 100e6 ;
% Samplig frequency in Hz ( fs > 2*fc )
d_ph = pi / 2 ;
% Phase devivation in rad ( pi / 2)
initial_phase = 0 ;
% Initial phase angle of the phase modulated sign.

x = 2*sin(2*pi*fm_sign*t);
% Message Signal

Phase_Modu_Signal = pmmod(x,fc_sign,fsamp,d_ph,initial_phase);
% Phase modulated siganl

figure
plot(t,x,
'.b')
title(
'Message Signal in Hz')
xlabel(
'Time in (\itsecond)')
ylabel(
'Magnitude')
grid
on

figure
plot(t,Phase_Modu_Signal)
title(
'Modulated Signal in Hz')
xlabel(
'Time in sec')
ylabel(
'Magnitude')
grid
on

PDM = pmdemod(Phase_Modu_Signal,fc_sign,fsamp,d_ph,initial_phase);
% Phase demodulated Signal

figure
plot(t,PDM,
'.k')
title(
'Demodulated Signal')
xlabel(
'Time in sec')
ylabel(
'Magnitude')
grid
on

## Frequency Modulation and Demodulation -

### Matlab Program -

%  FREQUENCY MODULATION  %    AND DEMODULATION

clc ;
clear
all ;
close
all ;

t = 0 : 10e-7 : 0.001 ;

%  SIGNAL PARAMETERS  %

freq_m = 1e3 ;
% Freq of message signal in ( Hz )
freq_c = 20e6 ;
% Freq of carrier signal in ( Hz )
freq_samp = 100e6 ;
% Samplig frequency in Hz ( fs > 2*fc )
df = 8e6;
% Frequency devivation in Hz
ini_phase = 0;
% Initial phase angle of the frequency modulated signal

x = 2*sin(2*pi*freq_m*t);
% Message Signal

Freq_Modu = fmmod(x,freq_c,freq_samp,df,ini_phase);
% Frequency modulated siganl

figure
plot(t,x,
'.r')
title(
'Message Signal in Hz')
xlabel(
'Time in \itsec')
ylabel(
'\itMagnitude')
grid
on

figure
plot(t,Freq_Modu)
title(
'Modulated Signal')
xlabel(
'Time in \itsec')
ylabel(
'\itMagnitude')
grid
on

Freq_DeMod = fmdemod(Freq_Modu,freq_c,freq_samp,df,ini_phase) ;
% Frequency demodulated Signal

figure
plot(t,Freq_DeMod,
'.k')
title(
'Demodulated Signal')
xlabel(
'Time in \itsec')
ylabel(
'\itMagnitude (Hz)')
grid
on

### Output Results or Plot -

For more MATLAB Code and program

Please Like, Comment, follow our blog for new updates and Share and email subscribe for latest update
! THANK YOU !