LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cic fix point filter

Solved!
Go to solution

I can get the easy one: the word length for signed types does include the sign bit. This is consistent with integers, where an I8 and a U8 both have the same total 8-bit range. One is just offset by 128 from the other.

 

For the CIC questions, I don't have an answer except to speculate that you're not hitting the worst case. What does your test look like? I've looked over the Meyer-Baese description, but still need some more work to come up to speed there.

Message 11 of 14
(1,515 Views)

Thanks for the answer!

 

My test is a simulated lock in without noise. I generate a sine with a certain frequency. This sine is multiplied with the cosine and sine of the same frequency and therefor demodulated. The DC of the product of the two sines is 0,5 and the DC of the sine cosine product is around zero. Both signals also containing double the frequency from the beginning. I think a picture is easier, left the sine*sine and right the sine*cosine:

CIC Input.PNG

The values are in the I24.1 format.

 

Some thoughts I had this morning:

 

1, I cant use the prune technique, because my rate factor is variable, and therefor the LSBs being discarded would have to be variable, too. (but understanding the technique would still be good 🙂 )

 

2, As I am always using powers of 2 for the rate factor, I can scale the output with bitshifting. e.g. R=512, the output can be bitshiftet 9 bits, without loosing precision. Which is a comfortable way of getting back width for the following "moving average".

 

3, Stating wikipedia on CIC. The bit growth of a recursive moving average is the same as of a CIC (no original quote 🙂 ). <--- Thats why I want to "reserve" place for the "MA-bits" :). The interesing point is, that also the Integer version of the CIC and MA is able to handle 65bits in the end.

I attach my selfmade bitgrowth calclulater. Maybe here is a mistake...

 

 

Thanks for your help JLewis

 

0 Kudos
Message 12 of 14
(1,483 Views)

PS: Maybe someone can tell me what the wirst scenario would be 🙂 So I can simulate it.

0 Kudos
Message 13 of 14
(1,465 Views)

Ok, the worst case is just maximum input all the time...so inserting a sine is not maximum all the time...I can now confirm the bit growth formula. If the bit length is longer than allowed, the filter output is nonsense!

 

 

Now to another question. I wanted to simulate the frequency response and step response for a CIC filter and/or a cascaded CIC filter system. I am using the "Digital Filter toolkit.vis".

 

Problem 1:

What I am not understanding, if I have a 100Hz signal and I insert it into a CIC filter with rate change factor 10, the output sample rate is 10Hz.

Due to Nyquist theorem the maximum frequency of a signal coming out of the CIC has to be 5Hz.

 

If I take a look at the frequency response calculated by the DFT vis, even signals of 50Hz are transmitted out of the CIC?

So is only the sample rate changed and the rest of the frequencies are aliasing into the output signal of the CIC?

 

Problem 2:

Cascading the two CIC filters is not possible, as they filter at different Samplerates! is there still a way to give out the cascaded frequency response and step response?

 

 

I attached the vi

0 Kudos
Message 14 of 14
(1,369 Views)