You are on page 1of 5

Modulation using MATLAB

Using MATLAB it is possible to simulate all the modulation techniques of both analog and digital signals.

Syntax:

Y = modulate(X, fc, fs, METHOD, OPT)

The above function modulates the message signal X with a carrier frequency fc and sampling frequency fs, using the modulation. OPT is an extra sometimes optional parameter whose Purpose depends on the modulation scheme chosen. Note: fs must satisfy fs > 2*fc + BW, where BW is the bandwidth of the modulated signal. (sampling theorem)

Method 'am' 'amdsb-sc' 'amdsb-tc'

Modulation scheme Amplitude modulation, double side-band, suppressed carrier Amplitude modulation, double side-band, suppressed carrier Amplitude modulation, double side-band, transmitted carrier. OPT is a scalar which is subtracted from X prior to multiplication by the carrier cosine. It defaults to min (min(X)) so the offset message signal is positive and has a minimum value of zero.

'amssb' 'fm'

Amplitude modulation, single side-band OPT not used. Frequency modulation. OPT is a scalar which specifies the constant of frequency modulation kf. kf=(fc/fs)*2*pi/max(max(abs(X))) by default for a maximum frequency excursion of Fc Hertz

'pm'

Phase modulation OPT is a scalar which specifies the constant of phase modulation kp.

Method

Modulation scheme kp = pi/max(max(abs(x))) by default for a maximum phase excursion of +/-pi radians.

'pwm'

Pulse width modulation. If you let OPT = 'centered', the pulses are centered on the carrier period rather than being "left justified".

'ppm'

Pulse position modulation. OPT is a scalar between 0 and 1 which specifies the pulse width in fractions of the carrier period. It defaults to .1.

'qam'

Quadrature amplitude modulation. OPT is a matrix the same size as X which is modulated in quadrature with X.

example: %to generate double side band suppressed carrier Amplitude modulation %

f=input('enter the frequency of message signal'); t=0:(1/f):2; x=4*sin(2*pi*t); subplot(2,1,1) plot(t,x); fc=input('enter the carrier frequency'); t1=0:(1/fc):2; xc=4*sin(2*pi*t1); subplot(2,1,2) plot(t1,xc); fs=2*(f+fc); y=modulate(x,fc,fs,'amdsb-sc'); figure(2) plot(t,y);

Modulated signal of a sine wave of frequency 1kHz by a message of 100Hz

%to generate double side band transmitted carrier Amplitude modulation % f=input('enter the ferquency of message signal'); t=0:(1/f):2; x=4*sin(2*pi*t); subplot(2,1,1) plot(t,x); fc=input('enter the carrier frequency'); t1=0:(1/fc):2; xc=4*sin(2*pi*t1); subplot(2,1,2) plot(t1,xc); fs=2*(f+fc); y=modulate(x,fc,fs,'amdsb-tc'); figure(2) plot(t,y);

Similar functions for modulation:

Command ammod ssbmod fmmod pmmod

Function Amplitude modulation Single side band amplitude modulation Frequency modulation Pulse modulation

syntax y=ammod(x,fc,fs) y = ssbmod(x, fc, fs) y=fmmod(x,fc,fs,frequency deviation) y=pmmod(x,fc,fs,phase deviation)

x=message signal fc=carrier frequency fs=sampling frequency y=modulated signal NOTE: For all types of modulation, in place of mod in the command, changing to demod, demodulation can be obtained. Instead 'x' being message signal, it'll be modulated signal.

You might also like