I have create a custom filter which fails to be applied to signals.
Within the code (attached) I have tried to apply the filter to a signal (combination of sin-waves) to study its effects. Using fvtool, the bode plot displays what I would expect, but it fails to be applied to a signal I provide, it only returns Nan for most of the elements. This should be a type of low pass Butterworth filter and should not change the signal I have provided by much.
I would appreciate if anyone can point out what I am doing wrong. In the code there is a simple snippet for a RC filter, which works fine, but the custom one fails.