Generate Matlab code that follows the specifications below: Generate a pulse sig
ID: 1716345 • Letter: G
Question
Generate Matlab code that follows the specifications below: Generate a pulse signal X possessing a magnitude equal to one between 0 and 1 seconds AND an amplitude of zero between 1 and 2 seconds. Generate a unit step signal Y from 0 to 2 seconds. Convolve signal X and Y. Save the answer in vector Z. Given that Matlab performs discrete time convolution, what would be the dimensions of vector Z? Graph X and Y versus time in two different graphs using the subplot() function. Each one second interval should contain 1000 elements and make sure you suppress any output.Explanation / Answer
1) Pulse signal
- fs=500; %sampling frequency
- T=2; %width of the rectangule pulse in seconds
- t=0:2/fs:0.5; %time base
- x=rectpuls(t,T); %generating the square waveplot(t,x,'k');
- title(['Rectangular Pulse width=', num2str(T),'s']);
- xlabel('Time(s)');
- ylabel('Amplitude');
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.