Lets say I have a Transfer function (H) plot as below. I need to find the SLOPE of the transfer function in dB/MHz.
That is... i need a plot (db/MHz) vs frequency.
How can i go about it ?
f = 0: 1e6 : 80e6;
H_db=20*log10(abs(H));
s=diff(H_db);
plot(f/1e6,s);
Do i need steps of 1 Mhz .. then its in db/Mhz.. or do i need to divide s
with something ?
or am i thinking about this all wrong ?
(update)
Lets say i have a transfer function below:
and then i find the db/mhz vs mhz plot using the following code:
step_size=1e6;
f_H = 0: step_size: fs_ADC+step_size; % i am using 'f_H' and 'f' since with diff function in the end I am short of one index for ploting.. i hope this is correct
f = 0: step_size: fs_ADC;
H = fir1(f_H);
H_db=20*log10(abs(H));
ss=diff(H_db); % is this correct ?
plot(f/1e6,ss)
or should i use :
ss=diff(H_db)./diff(f_H);
plot(f/1e6,ss)
Then i get the below figure: .. now i get the 10^-5 on the yaxis.
Please let me know