hi gsuarez,
Great code! It's exactly what I was looking for.
However, I'm getting an error while simulating it. Here's the command I'm using to simulate this,
frequency_plot(sc_out, 2.56e6, 1, 4, 1, 10000,1,1,3,0)
and here's the error,
??? Attempted to access temp(0); index must be a positive integer or logical.
Error in ==> snrflx_v2 at 117
f1=temp(templ)-1;
Error in ==> frequency_plot at 42
[snrdb,fundf,fout,xfout]=snrflx_v2(xt1,fs,tn,bin,f1,f2,win,dc);
Can you please help?