Tuesday 6 August 2013

Amplitude modulation Code in Matlab


Program

fs=500;
fc=50;
t=[0:2*fs]/fs;
x=2*sin(2*pi*t);
y=ammod(x,fc,fs);
z=fft(y);
f=[0:length(z)-1];
subplot(2,2,1);
plot(t,x);
xlabel('time');
xlabel('Freequency');
ylabel('amplitude');
title('Input Waveform');
subplot(2,2,2);
plot(f,y);
ylabel('amplitude');
title('modulated waveform');
subplot(2,2,3);
plot(f,z);
xlabel('Freequency');
ylabel('amplitude');
title('spectrum diagram');x= ammod(y,fc,fs);
subplot(2,2,4);
plot(t,x);
xlabel('time);
ylabel('amplitude);
title('demodulated waveform)




Output waveforms



SSB Modulator Internal Block Diagram





Internal Block diagram and Connections of SSB Modulator


Non Phase shifted Sinusoidal Input waveform - Message Signal

Non Phase shifted Sinusoidal Input waveform - Carrier Signal


Phase shifted Sinusoidal Input waveform - Message Signal


Phase shifted Sinusoidal Input waveform - Carrier Signal




Spectrum Analyser Block Properties



Spectrum Analyser Output




The Experiment

To perform this experiment first insert four sine wave blocks into the workspace

Then place two sine wave blocks together to a multiplier and the other two to another multiplier

In two of the sime wave blocks connected to the same multiplier change the inital phase reading to 90 degrees as shown in the source block parameters

Connect the outputs of the multipliers to an adder and the output of the adder to a spectrumm analyser

DSBSC using Internal Structure of blocks


DSBSC Internal Structure Block Diagram



Input Sine Wave 1 Parameters - Carrier Wave



Sine Wave Input Paraneters - Message Signal



Spectrum Analyser Output DSBSC

DSBSC


BLOCK DIAGRAM DSBSC MODULATOR


Source Block parameters



Modulator Properties DSBSC



DSBSC Modulated Wave

DSBSC Demodulator Blockset

DSBSC Demodulator Properties








DSBSC Demodulated Waveform

SSB MODULATION


MODULATOR BLOCKSET


SOURCE BLOCK PARAMETERS




MODULATOR PROPERTIES

MODULATED WAVE


DEMODULATION BLOCKSET


DEMODULATOR PROPERTIES WINDOW

DEMODULATED WAVEFORM



Freequency Modulation

FREQUENCY MODULATION

The Blocks required for frequency modulation are:
1.Sine wave Block
2. Frequency Modulation Block
3. Sampling Scope

Connect the blocks as shown in the diagram below

Block Diagram

The parameters for the Modulator along with freequency values and other necessary settings are shown in the diagram below


Modulator properties

The source parameters including frequency of the input sine wave are shown in the picture below


Source block parameters

The output waveform appears in the CRO as:

Modulated waveform

For demodulation connect a FM demodulator block in between the FM modulator block and the sampling scope and connect them as shown in the diagram below.




Demodulator block diagram
With the settings of the source and modulator blocks remaining the same adjust the demodulator to the necessary frequency and other parameters as necessary and as shown in the picture below:




FM Demodulator properties

The Demodulated output appears in the CRO as thus:



Demodulatoed Waveform





AM Modulation

The Block diagrams required for the AM Modulation are:
1. Sine Wave Block

2. Amplitude Modulator Block
3.Sampling Scope

Connect the blocks as shown in the diagram below




Block diagram of AM modulator in SIMULINK


The parameters of the input sine wave block are as given in the block below.
Set the parameters as shown in the diagram



Source block properties along with their values

The values of the modulator along with requisite frequencies are as given below


Modulator properties along with their values


The DSBSC modulated waveform is as given below


AM Modulated wave

                                                   Demodulated or Input wave









The lab maual can be downloaded from this link along with all thie pics above

https://docs.google.com/file/d/0B_sevGyWoSsNdEsxOE9SbzctUWc/edit?usp=sharing