Blank plot on my computer
8 views (last 30 days)
Show older comments
This is my code and I was wondering why is my figure 6 empty:
https://dontpad.com/labpdsmiki
3 Comments
Mathieu NOE
on 16 May 2024
you have a problem with your butterworth filters :
[bd1,ad1]=impinvar(bs1,as1,Fs);
bd1 is only NaN values , so everything you filter with this is going to be NaN and you end up with blank figure
Also , important information : you are designing very high order analog butterworth filters , to then transform them in digital form with impinvar (why not then directly use the digital butter way ?)
second info : you get NaN because your filters are unstable :
It is best not to use the transfer function implementation of discrete (digital) filters,because those are frequently unstable. Use zero-pole-gain and second-order-section implementation instead.
%Example :
fc = 50;
fs = 1e4;
[z,p,k] = butter(6,fc/(fs/2));
[sos1,g1] = zp2sos(z,p,k);
figure(1)
freqz(sos1,2^16,fs)
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





