Question: please write the code properly, with comments. 2. (20 points). Write an M-file to determine the frequency response for a passive 1 order lowpass filter

please write the code properly, with comments.
2. (20 points). Write an M-file to determine the frequency response for a passive 1" order lowpass filter with a cutoff frequency of 500 Hz (fout = 500 = 2#RC). (Reference the 1" order passive lowpass filter worksheet on Canvas). a) Your program should meet the following requirements. . Have the user input the capacitance in F and then calculate the resistance to provide the proper cutoff frequency. Have your program check to verify that the resistance is between 1K and 100K. If it is not have the user enter a new capacitance value. Have your program determine the magnitude in dB and the phase in degrees at one frequency . Run your program when: The input frequency is at 500 Hz and the capacitance is at 100uF. Then, show your results. The input frequency is at 500 Hz and the capacitance is at 100nF. Then, show your results. . b) Revise your program such that the following array of values for frequency is used freq=[50 500 5e3 50e3]: Be sure to use the dot operator such that element-by-element operations are performed. Run your program when the capacitance is at 100nF and show your results
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
