MATLAB Code For Generating IMPULSE SIGNAL

%%%%%% UNIT IMPULSE SIGNAL %%%%%%%%%%%%
clc;
clear all;
close all;
t=-2:1:2;
y=[zeros(1,2),ones(1,1),zeros(1,2)];subplot(2,2,1);stem(t,y);
ylabel('Amplitude -->');
xlabel('(a) n -->');

Contact:  
Mr. Roshan P. Helonde
Mobile: +91-7276355704
WhatsApp: +91-7276355704
Email: roshanphelonde@rediffmail.com
Share:

MATLAB Code For Amplitude Modulation

AM is a method of transmitting signals, such as sound or digital information, in which the amplitude of carrier wave is changed 

according to the message signal. AM is widely used in electronic communication field. The plotting of AM signal using MATLAB 

is very easy.

%%%%%%%%%%% Amplitude Modulation %%%%%%%
clc;
clear all;
close all;
t=0:0.001:1;
set(0,'defaultlinelinewidth',2);
A=input('Enter the amplitude of message signal - :  ');
fm=input('Enter the Message frequency - :  ');% Message signal frequecny 
fc=input('Enter the Carrier frequency - :  ');% Carrier signal frequency 
mi=input('Modulation Index - : ');

if (mi >1 || mi < 0 )
disp('Enter value between 0 and 1');
break; 
end
x=A*sin(2*pi*fm*t);%Message Signal
subplot(3,1,1);%Plotting frame divided in to 3 rows and this fig appear at 1st
plot(t,x);
xlabel('Time');
ylabel('Amplitude');
title('Message Signal');
grid on;

c=A*sin(2*pi*fc*t);%Carrier Signal
subplot(3,1,2);
plot(t,c);
xlabel('Time');
ylabel('Amplitude');
title('Carrier Signal');
grid on;

am=(A+mi*x).*sin(2*pi*fc*t);%AM Signal, Amplitude of Carrier changes to (A+Message)
subplot(3,1,3);
plot(t,am);
xlabel('Time');
ylabel('Amplitude');
title('AM Signal');
grid on;

%%%%%%%%%%%% END %%%%%%%%%%%55

Enter the amplitude of message signal - :  2
Enter the Message frequency - :  5
Enter the Carrier frequency - :  100
Modulation Index - : 0.5

Contact:  
Mr. Roshan P. Helonde
Mobile: +91-7276355704
WhatsApp: +91-7276355704
Email: roshanphelonde@rediffmail.com
Share:

MATLAB Code For Frequency Modulation

In FM, frequency of the carrier signal having high frequency is varied in accordance with the instantaneous amplitude of the 

modulating signal having low frequency. Frequency modulated signals are widely used in television and radio transmission 

systems. FM signals can be easily plotted using simple MATLAB functions. 



%%%%% Program For Frequency modulation %%%%%%%%%%%%%
clc;
clear all;
close all;
fm=input('Enter the Message Frequency-:  ');
fc=input('Enter the Carrier Frequency-: ');
mi=input('Modulation Index-: ');
t=0:0.001:1;
m=sin(2*pi*fm*t);% Message Signal
subplot(3,1,1);
plot(t,m);
xlabel('Time');
ylabel('Amplitude');
title('Message Signal');
grid on;

c=sin(2*pi*fc*t);% Carrier Signal
subplot(3,1,2);
plot(t,c);
xlabel('Time');
ylabel('Amplitude');
title('Carrier Signal');
grid on;
y=sin(2*pi*fc*t+(mi.*sin(2*pi*fm*t)));%Frequency modulation
subplot(3,1,3);
plot(t,y);
xlabel('Time');
ylabel('Amplitude');
title('FM Signal');
grid on;


%%%%%%%%%%%%%%%%% END %%%%%%%%%%%%
Example
Enter the Message Frequency-:  10
Enter the Carrier Frequency-: 100
Modulation Index-: 5

Contact:  
Mr. Roshan P. Helonde
Mobile: +91-7276355704
WhatsApp: +91-7276355704
Email: roshanphelonde@rediffmail.com
Share:

Matlab Code for Square Wave Samping And Quantization

% program for sampling and quantization
clc
close all;
clear all;
t= [0:.1:2*pi];
s= square(2*t,50);
subplot(3,1,1)
plot(t,s)
title('Input Square signal')
subplot(3,1,2)
stem(t,s)
title('sampling of signal ')
v= [-1.8:.2:1]
w = [-2:.2:1]
[x,y] = quantiz(s,v,w);
subplot(3,1,3)
plot(t,s,t,y,'r')
legend('original signal ', 'quantization signal')

Contact:  
Mr. Roshan P. Helonde
Mobile: +91-7276355704
WhatsApp: +91-7276355704
Email: roshanphelonde@rediffmail.com

Share:

Matlab Code for separating RGB plane of an Image


Contact:  
Mr. Roshan P. Helonde
Mobile: +91-7276355704
WhatsApp: +91-7276355704
Email: roshanphelonde@rediffmail.com
Share:

FUNCTION USED IN MATLAB FOR IMAGE

Contact:  
Mr. Roshan P. Helonde
Mobile: +91-7276355704
WhatsApp: +91-7276355704
Email: roshanphelonde@rediffmail.com
Share:

IMAGE FORMETS

Contact:  
Mr. Roshan P. Helonde
Mobile: +91-7276355704
WhatsApp: +91-7276355704
Email: roshanphelonde@rediffmail.com

Share:

MATLAB Code For RESIZING OF IMAGES




Contact:  
Mr. Roshan P. Helonde
Mobile: +91-7276355704
WhatsApp: +91-7276355704
Email: roshanphelonde@rediffmail.com
Share:

Contact Us

Name

Email *

Message *

Blog Archive

Popular posts