Seeing that the filter was working fine I changed the noise to be changing in frequency by 5Hz plus or minus given by the following equation.
where in the above equation noamp is the maximum amplitude of the noise
signal, t is the sampling time period of the signal and k is the sample
number.
Firstly the noise signal of an amplitude of 0.1 was taken and the
simulation performed. The value of was still the same. The outputs
are as shown in the following plots. The filter performed well and the
output was similar to the original signal.
Next the maximum amplitude of the noise was increased to 0.2 and the
was still kept the same. The filter worked well even then. The
plots are appended.