Write a matlab function to calculate the bandwidth of a signal. The specific form of the function is to be:
function [bw fc] = bandwidth(t,x,R,pass)
where the input signal {t,x} is a time-domain signal, R is the spectral density ratio that defines
the bandwidth, and pass is a string (‘low’ or ‘band’) that defines the signal type as either
lowpass or bandpass. The output bw is the bandwidth and fc is the frequency cutoff(s) that
defines the bandwidth. If the signal is lowpass, then bw is scalar and fc can be left empty. If the
signal is bandpass, then fc is a 2-component vector where the bandwidth estimate is given by
bw = fc(2)-fc(1).
Do not use for loop
I think this time we will achieve :)........................................................................................................................................................................