Before quantization of filter coefficient, it behaves well, but after quantization the amplitude drops to 0.52186, which is expected to be 1000(fig.1). But according to the amplitude response in filterDesigner(fig.2). The 200Hz wave shouldn't decrease so much after filtering. Could someone tell me why the abnormal attenuation happens? Why is it 0.52186?
Fig.2 amplitude response
Matlab code is as follows
N = 2000;
f0=200;
f1=800;
fs=2000;
n=1:N;
y =1000*sin(2*pi*f0.*n/fs)+500*sin(2*pi*f1.*n/fs);
Hd = filter_below500Hz;
d = filter(Hd,y);
figure(2)
subplot(2,1,1)
plot(y);
title({['y,before filtering']});
subplot(2,1,2)
plot(d);
title({['d,after filtering']});
filter_below500Hz
$\endgroup$