Using MATLAB CODE
Posted: Tue May 24, 2022 8:41 am
Using MATLAB CODE
(10 POINTS) (a) Write an M-file called syn sin.m that will synthesize a waveform in the form of: [5Marks] x(1) Σ cos(2m fut + x) Your function should contain the following: function [xx.]-syn_sin(fthk,fs, dur, tatar) %SYN SIN Function to synthesize a sum of cosine waves % usage: % [xx.ft]-syn_sin(fk,thk, fs, dur, tstart) % tk-vector of frequencies % (these could be negative or positive) % fs the number of samples per second for the time axis % dur-total time duration of the signal % start-starting time (default is zero, if you make this input optional) % xx-vector of sinusoidal values % tt-vector of times, for the time axis !!Note That Your Function Will Contain One Loop!! (b) Use your function to find the sum of three signals with the following inputs: [SMarks] FK-[100 200 300]; thk-[pi pi/2 2*pil; fs-11024; nd
(10 POINTS) (a) Write an M-file called syn sin.m that will synthesize a waveform in the form of: [5Marks] x(1) Σ cos(2m fut + x) Your function should contain the following: function [xx.]-syn_sin(fthk,fs, dur, tatar) %SYN SIN Function to synthesize a sum of cosine waves % usage: % [xx.ft]-syn_sin(fk,thk, fs, dur, tstart) % tk-vector of frequencies % (these could be negative or positive) % fs the number of samples per second for the time axis % dur-total time duration of the signal % start-starting time (default is zero, if you make this input optional) % xx-vector of sinusoidal values % tt-vector of times, for the time axis !!Note That Your Function Will Contain One Loop!! (b) Use your function to find the sum of three signals with the following inputs: [SMarks] FK-[100 200 300]; thk-[pi pi/2 2*pil; fs-11024; nd