Forums

THD with CIC and conventional (FIR) filter - a comparison with PDM input signal

Started by chalil 5 years ago12 replieslatest reply 5 years ago405 views

while testing with a synthetic PDM (like sigma-delta) signal, I came across an interesting result. The CIC filter with N=5 and M=1 is going to give better performance than an FIR filter of the order 128 for a given downsampling factor 16. I was in an impression that CIC filter is efficient however, the accuracy is going to be lesser than that of an FIR of nominal order. Any comments ? 

thd1_8908.jpg

the top one is with cic and bottom one is the result with FIR. note that the THD is really comparable. No CFIR is includes as i feel CFIR is not going to affect the THD adversely. 

the code i used for creating the pdm sample is attached along with other utility scripts...tst_pdm.m

pcm2pdm.m


[ - ]
Reply by fred_harrisJanuary 16, 2018

Chalil,


I'm suggesting you read a paper i wrote with title

Reduce Energy Requirements by Coupling a Poly-Phase Pre-filter and CIC Filter in High-Performance Sigma-Delta A/D Converters. i have attached a copy to this response.


to entice you to read the paper I have copied the abstract

Abstract— The CIC filter is often used as a decimating filter to simultaneously reduce bandwidth and sample rate of the time series obtained at the output of a 1-bit Sigma-Delta converter. The conventional motivation for using the CIC is that the filtering is performed with only registers and adders, there being no multipliers in the CIC filter chain. We note that every FIR filter processing the output of a 1-bit sigma delta converter can also be implemented without multipliers. The CIC filter does not take advantage of the fact that the input samples are limited to two input levels. It is possible to design FIR filters using the two level input signal to form efficient multiply free filters that compare favorably with the CIC filter. We present here a partition of the filter and down sampling task into a cascade of a polyphase pre-filter that performs a first bandwidth and sample rate reduction without multiplies followed by a reduced sample rate CIC filter performing the second bandwidth and sample rate reduction. Operating the second filter as a CIC at a reduced output rate reduces its workload and the bit width required by its accumulators.


I believe the polyphase FIR actually outperforms the CIC... for the same number of adds as performed in the CIC integrator chain, the FIR has better stop band and better passband than the cic.... This is because the repeated stopband zeros of the CIC are no match for the distributed zeros of the properly designed CIC. We also don't have to correct for the sinx/x mainlobe tilt nor do we require have the wide width accummulator registers of the CIC integrators... 


Would be pleased to continue this discussion with you..


fred 


[ - ]
Reply by chalilJanuary 17, 2018

Thank you Fred. Please attach the paper once again. Looks like the document is missing in the thread.  

[ - ]
Reply by fred_harrisJanuary 17, 2018
[ - ]
Reply by chalilJanuary 17, 2018

Thank you Fred. I tried to apply the hybrid approach as in your paper. the result is attached. 

fig2.JPG 

the bottom one is the new plot which uses pre fir filter along with a cic. 

to get the configuration similar to the Figure 9 of your paper, i did:

1. increased the sigma-delta to 64. 

2. used 16 for pre fir and rest (=4) for the cic

Please share your insight. the changed script is attached. tst_pdm.m

[ - ]
Reply by fred_harrisJanuary 17, 2018

Chalil,


I tried running your code... i don't have thd(-,-)

Strange as it seems, try changing the frequency of the fundamental so it is no longer harmonically related to the clock. I think the distortion is a quirk of a the harmonic lock. 

try changing your f1 from 1000 to 1001.


and run your system again... alternately add a low level (-100 db) random noise to your xx sequence. the frequency change is simpler.

let me know if this helps... I run into this problem when I want to demo quantizing noise... when the frequency is harmonically related to sampling clock, the quantizing noise is periodic... you want to avoid this effect by the two options I suggested.


fred

[ - ]
Reply by chalilJanuary 17, 2018

Thanks Fred for further tips. I changed the freq from 1k to 1001. and added low amp white noise. the modified thd is attached. 

fig3_5856.jpg

A) top left - with cic

B) right - with fir

C) bottom - hybrid (fir + cic)

I was expecting B to be better than A, and C. 

[ - ]
Reply by fred_harrisJanuary 17, 2018

last comment... don't use full amplitude in sigma-delta ... scale input to be less than 1 as shown

x = 0.9*sin(1*pi*[-n:1:n]*(f1/fs)); 
[ - ]
Reply by fred_harrisJanuary 17, 2018
[ - ]
Reply by chalilJanuary 18, 2018

Nice plots Fred. This particular plot gives a feel that fir is superior to cic. As a homework, the number of sample used for my computation and computation and the THD routine need to be checked against this results. 

Thanks for all your insights and tips. Once again thanks for the paper - very relevant to industry ! 


[ - ]
Reply by fred_harrisJanuary 17, 2018

One more suggestion, change your filter to have falling sidelobes rather than constant sidelobes.. use my modified remez.. that calls myfrf... see remez_frf_example to see the change... run remez_frf_example to see benefit.


myfrf.m    remez_frf_example_2a.m

[ - ]
Reply by chalilJanuary 17, 2018

Thanks again Fred. It gave 3.5dB improvement in THD; still behind. Please see the attached plots. the right bottom is the frf version, rest are the same...

fig4_63968.jpg


the changed script is attached. please crosscheck usage of frf. tst_pdm.m

[ - ]
Reply by fred_harrisJanuary 17, 2018

I have spent a fair amount of time  with your code so i feel ok making some other suggestions


get rid of the window on the data... you want the window in the transform

%x1 = 0.8*hann(length(x)).*x';

x1=x+0.001*randn(1,length(x));  % instead


Apply window this way...

N_xfrm=8192*8;
ww=kaiser(N_xfrm,15)';
ww=ww/sum(ww);

subplot(2,1,1);
ff=(-0.5:1/N_xfrm:0.5-/N_xfrm)*fs
plot(ff,fftshift(20*log10(abs(fft(yy(1:N_xfrm).*ww)))));
grid on;
axis([-fs/2 fs/2 -120,10])

subplot(2,1,2);
plot(ff,fftshift(20*log10(abs(fft(yy1(1:N_xfrm).*ww)))));
grid on;
axis([-fs/2 fs/2 -120,10])


Finally, try running this take home exam problem solution... 3-rd order sigma_delta


sig_del_2015.m