Write a new MATLAB function as described in the following: 1. The new function will have...

70.2K

Verified Solution

Question

Electrical Engineering

Write a new MATLAB function as described in the following:

1. The new function will have three input parameters: f, W, C.2. Parameter f will specify the frequency of the square wave. 3.The parameter W will specify the width of the single pulse as anumber of sample periods. 4. The parameter C will specify thenumber of square wave cycles. 5. Calculate a number of samples, N,to run the simulation for both waveforms. 6. Create one signal thatis a square wave of period 2W samples and lasts for a duration of Ccycles. 7. Create a signal beginning with a single pulse ofamplitude 1 and a width of W samples followed by N-W samples withamplitude of 0. 8. Plot time and frequency domain plots for each.Use subplots to show all four graphs on the screen at once,arranged the same way as in the reference lecture slide. Scale theplots as necessary so that the desired characteristics can beeasily seen. Label the x-axis with the correct units oftime/frequency. Run the new function with f=1000, W=20, andC=10.

Answer & Explanation Solved by verified expert
4.3 Ratings (783 Votes)
FWC function signalpulse define default input parameter values if nargin 3 C 10 end C number of cycles of square wave if nargin 2 W 20 end W number of samples for pulse    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students