# FPGA File

Description
FPGA file

View again

All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Information
Category:

## Documents

Publish on:

Views: 20 | Pages: 16

Share
Transcript
Program No. 1 Question.   Write a program in MATLAB for Plotting Continuous Signal of unit impulse, unit step and unit ramp.   Solution:   a)   Unit impulse >>%unit impulse >>subplot(2,1,1); >> t=-2:1:2; >> y=[zeros(1,2),ones(1,1),zeros(1,2)]; >>plot(t,y); >>xlabel('Time'); >>ylabel('Amp'); >>title('UNIT IMP');  b)   Unit step >> % unit step >>subplot(2,1,2); >> t=-1:1:6; >> y=[zeros(1,1),ones(1,7)]; >>plot(t,y); >>xlabel('Time'); >>ylabel('Amp'); >>title('UNIT Step') c)   Unit ramp >> %unit ramp >>subplot(2,1,3); >> t=0:1:3; >> y=t; >>plot(t,y); >>xlabel('Time'); >>ylabel('Amp'); >>title('UNIT RAMP');       Program No. 2   Question.   Write a program in MATLAB for Plotting Continuous Signal of exponential wave, rectangular wave, sine wave, cosine wave and signum function. Solution: a)   Exponential wave >> %exponential wave >>subplot(2,2,1); >> t=0:0.2:6; >> y=exp(t); >>plot(t,y); >>xlabel('Time'); >>ylabel('Amp'); >>title('Exponential function');  b)   Rectangular Wave: >> %rectangular pulse >>subplot(2,2,2); >> t=-2:1:2; >> y=[ones(1,5)]; >>plot(t,y); >>xlabel('Time'); >>ylabel('Amp'); >>title('Rectangular pulse'); c)   Sine Wave: >> %sine wave >>subplot(2,2,3) >> t=-pi:0.1:pi; >> y=sin(2*pi*t); >>plot(t,y); >>xlabel('Time'); >>ylabel('Amp'); >>title('Sine wave'); d)   Cosine fun >> %Cosine fun >>subplot(2,2,4); >> t=-pi:0.1:pi; >> y=cos(2*pi*t); >>plot(t,y); >>xlabel('Time'); >>ylabel('Amp'); >>title('Cosine Wave');  e)   Signum function >> %signum >>subplot(2,2,5); >> t=-4:1:4; >> y=[-ones(1,4),ones(1,5)]; >>plot(t,y); >>xlabel('Time'); >>ylabel('Amp'); >>title('Signum');
Related Search
Similar documents

View more...