Monday, November 22, 2010
0
Monday, November 22, 2010
Noufel Backer
matlab program for amplitude modulation
PROGRAM
% amplitude modulated wave
n=0:100;
m=0.3;fm=0.01;fc=0.1;
xm=sin(2*pi*fm*n);
xc=sin(2*pi*fc*n);
y=(1+m*xm).*xc;
stem(n,y);
grid;
xlabel('time index n');
ylabel('amplitude');
Read more...
% amplitude modulated wave
n=0:100;
m=0.3;fm=0.01;fc=0.1;
xm=sin(2*pi*fm*n);
xc=sin(2*pi*fc*n);
y=(1+m*xm).*xc;
stem(n,y);
grid;
xlabel('time index n');
ylabel('amplitude');
OUTPUT
0
Noufel Backer
SINE WAVE
SOURCES->SINE WAVE
SCOPE
SIMULINK->SINK->SCOPE
CLICK ON PARAMETER ICON ON SCOPE DISPLAY
GENERAL
AXES:NO OF AXES:1
TIME RANGE:AUTO
SPECTRUM SCOPE
SIGNAL PROCESSING BLOCKSET->SINKS->SPECTRUM SCOPE
SET THE PROPERTIES AS SHOWN BELOW
CLICK ON SIMULATION ICON ON MODEL WINDOW AND OBSERVE OUTPUT
Read more...
MATLAB SIMULINK PROGRAM FOR DISCRETE SINE WAVE
SINE WAVE
SOURCES->SINE WAVE
SOURCE BLOCK PARAMETERS
SCOPE
SIMULINK->SINK->SCOPE
CLICK ON PARAMETER ICON ON SCOPE DISPLAY
GENERAL
AXES:NO OF AXES:1
TIME RANGE:AUTO
SPECTRUM SCOPE
SIGNAL PROCESSING BLOCKSET->SINKS->SPECTRUM SCOPE
SET THE PROPERTIES AS SHOWN BELOW
CLICK ON SIMULATION ICON ON MODEL WINDOW AND OBSERVE OUTPUT
Wednesday, November 17, 2010
0
Wednesday, November 17, 2010
Noufel Backer
Read more...
MATLAB PROGRAM FOR Ramp continous and discrete
PROGRAM
% ramp continous and discrete
n=0:.1:10;
subplot(211); %breaks figure window into 2*1 matrix and select 1st axis for current plot
plot(n,n); %plotting the value of n against n for getting ramp signal
title('ramp continous');
xlabel('time');
ylabel('amplitude');
subplot(212); %breaks figure window into 2*1 matrix and select 2nd axis for current plot
stem(n,n); %discrete plot
title('ramp discrete');
xlabel('time');
ylabel('amplitude');
n=0:.1:10;
subplot(211); %breaks figure window into 2*1 matrix and select 1st axis for current plot
plot(n,n); %plotting the value of n against n for getting ramp signal
title('ramp continous');
xlabel('time');
ylabel('amplitude');
subplot(212); %breaks figure window into 2*1 matrix and select 2nd axis for current plot
stem(n,n); %discrete plot
title('ramp discrete');
xlabel('time');
ylabel('amplitude');
OUTPUT
0
Noufel Backer
Step Wave Continous and Discrete
PROGRAM
Read more...
% step discrete and continous
n=ones(1,20); % creates an array of 20 elements with value 1;
x=0:1:19;
subplot(211); %breaks figure window into 2*1 matrix and select 1st axis for current plot
stem(x,n); %discrete step wave
title('discrete step');
xlabel('time');
ylabel('amplitude');
subplot(212); %breaks figure window into 2*1 matrix and select 2nd axis for current plot
plot(x,n); %continous sine wave
title('continous step');
xlabel('time');
ylabel('amplitude');
n=ones(1,20); % creates an array of 20 elements with value 1;
x=0:1:19;
subplot(211); %breaks figure window into 2*1 matrix and select 1st axis for current plot
stem(x,n); %discrete step wave
title('discrete step');
xlabel('time');
ylabel('amplitude');
subplot(212); %breaks figure window into 2*1 matrix and select 2nd axis for current plot
plot(x,n); %continous sine wave
title('continous step');
xlabel('time');
ylabel('amplitude');
OUTPUT
0
Noufel Backer
Read more...
matlab program for Step Wave Discrete
PROGRAM
% step discrete
n=ones(1,20); % creates an array of 20 elements with value 1;
x=0:1:19;
stem(x,n); %discrete step wave
title('continous step');
xlabel('time');
ylabel('amplitude');
n=ones(1,20); % creates an array of 20 elements with value 1;
x=0:1:19;
stem(x,n); %discrete step wave
title('continous step');
xlabel('time');
ylabel('amplitude');
0
Noufel Backer
matlab program for sine wave generation(Continous and discrete)
Program
f=input('enter the frequency');
y=a*sin(2*pi*f*t); %calculation of sine wave
plot(t,y); %plot the value of t against y
title('continous sinewave'); % title of the graph
xlabel('time');
ylabel('amplitude');
% discrete sine wave
clc; %clear command window
t=0:.1:10; %create an array t starting from 0 and .1 is the increment and 10 final value
a=input('enter the amplitude');
f=input('enter the frequency');
y=a*sin(2*pi*f*t); %calculation of sine wave
stem(t,y); %discrete plot the value of t against y
title('discrete sinewave'); % title of the graph
xlabel('time');
ylabel('amplitude');
Read more...
% continous sine wave
t=0:.1:10; %create an array t
a=input('enter the amplitude');t=0:.1:10; %create an array t
f=input('enter the frequency');
y=a*sin(2*pi*f*t); %calculation of sine wave
plot(t,y); %plot the value of t against y
title('continous sinewave'); % title of the graph
xlabel('time');
ylabel('amplitude');
output
% discrete sine wave
clc; %clear command window
t=0:.1:10; %create an array t starting from 0 and .1 is the increment and 10 final value
a=input('enter the amplitude');
f=input('enter the frequency');
y=a*sin(2*pi*f*t); %calculation of sine wave
stem(t,y); %discrete plot the value of t against y
title('discrete sinewave'); % title of the graph
xlabel('time');
ylabel('amplitude');
OUTPUT
0
Noufel Backer
MATLAB Program to Add 2 Numbers.
Lets Write a simple program to add two Programs
As i had already discussed you can either execute program in the Command Window or save a program as .m file.
1) Executing a program in a Command Window
Just select the Command Window and write the necesary codes as shown below
The figure shows how to add 2 numbers.
Here i have used two variables x and y
just write in the command window x='any value say 2' and y='say2'
then write x+y and press enter.
You wil get Result 4 in the command window as shown above
Simple Huh!
But for larger programs it is neccessary to save the program.
Program to add two numbers using text editor
Select Text Editor by using the Following Step
Select file menu
>select New
>select .m file
>type the program name and save the file and type the program code
NOTE:We can write comments between the codes using the % symbol.just type % and write the codes
Here Goes the Program
Read more...
As i had already discussed you can either execute program in the Command Window or save a program as .m file.
1) Executing a program in a Command Window
Just select the Command Window and write the necesary codes as shown below
The figure shows how to add 2 numbers.
Here i have used two variables x and y
just write in the command window x='any value say 2' and y='say2'
then write x+y and press enter.
You wil get Result 4 in the command window as shown above
Simple Huh!
But for larger programs it is neccessary to save the program.
Program to add two numbers using text editor
Select Text Editor by using the Following Step
Select file menu
>select New
>select .m file
>type the program name and save the file and type the program code
NOTE:We can write comments between the codes using the % symbol.just type % and write the codes
Here Goes the Program
clc; %clear command window
x=input(' x='); %accept tha value of x
y=input(' y='); %accept tha value of y
z=x+y;
disp('z='); %display function inbuilt in matlab to display a string
disp(z); %display the value of z
0
Noufel Backer
Introduction to MATLAB
MATLAB(MATrixLABoratory) is a high speed software designed to solve complex engineering problems within a second! It covers all sections of Electronics such as SignalProcessing,Control System,Image Processing,Communication and lot more! It has separate toolboxes for performing this functions.It has many inbuilt functions to perform the complex calculations.In short,MATLAB makes Engineering Computing Easier!
Read more...
Subscribe to:
Posts (Atom)



















