FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
6359 Discussions

Interpolation with CIC Filter

Altera_Forum
Honored Contributor II
2,000 Views

Hello! 

 

I want to interpolate a 13.5 kHz sinus signal, which is generated with a NCO at a sampling rate of 54 Khz. I want a sampling of 5,4 MHz.  

So i tried to use a CIC-Filter with rate = 100. 

What I get at the output of the CIC-Filter is a 4.5 kHz sinus signal !! 

--> there is something wrong! 

What is the problem here ?? 

I tried different types of stages and delays, but I won't get a 13.5 sinus. 

please help me.. 

Thanks!
0 Kudos
15 Replies
Altera_Forum
Honored Contributor II
603 Views

it could be useful a post of your schematic. 

How many samples has a single period of the high frequency sine signal at the output?
0 Kudos
Altera_Forum
Honored Contributor II
603 Views

The samples at the output are ok. It has to be 400 samples right?? I proof that with an analog oscillator. 

 

Maybe you have a look at the image... 

 

Thanks for your help!
0 Kudos
Altera_Forum
Honored Contributor II
603 Views

i think there is a problem with your CIC hardware, because input samples should be synchronized with c0 clock and output samples should be synchronized with c1 clock. Note this, for every input sample 100 samples must go out. 

 

In your hardware, an input sample (synchronized with c0) is read 100 times by a module clocked with c1. 

 

As you are using two clocks, in your CIC hardware a dual-clock FIFO for crossing clock domains must be included.
0 Kudos
Altera_Forum
Honored Contributor II
603 Views

Ok. I was thinking in your way too. Because the differentiators has to be clocked with the lower sample rate and the integrators has to be clocked with the higher rate. But I thought the CIC-Filter would do this "clocking" automatically. 

The CIC-Filter generated by the MegaWizard has only one clock-input.....how should I solve the problem??...
0 Kudos
Altera_Forum
Honored Contributor II
603 Views

so, you are driving in the wrong way the avalon-streaming signals. in_valid line must be asserted every 100 cycles of 54 MHz clock.

0 Kudos
Altera_Forum
Honored Contributor II
603 Views

parrado, while i agree with you conceptually this is not how the Altera generated test bench operates. 

 

tobias, have you taken a look at the CIC generated test bench? also take a look at the output error signal in your project.
0 Kudos
Altera_Forum
Honored Contributor II
603 Views

Aha! 

 

@Parrado: 

This could be the solution! I will try tomorrow in the lab.....in germany know it's 10:20 pm.  

 

Thank You parrado! I will let you know if it works.... 

 

 

@thepancake: 

I will have look at the generated testbench file and the error output too. 

I will let you know tomorrow. Thanks..
0 Kudos
Altera_Forum
Honored Contributor II
603 Views

Hello! 

 

I tried to connect the "valid in" with the lower clock. When I set the rate to 5 it works fine. But with a higher rate like 10 or 100 I get a 4.5 kHz-Sinus....it's weird.  

But I think it is the right way to "clock" the valid in, because in the "functional description" of the CIC-Filter you can see that the "valid in" is clocked too.
0 Kudos
Altera_Forum
Honored Contributor II
603 Views

I am not fans of CIC IP cores but judging by your last work there is possibilty of error. You are supposed to drive the input data in once every 100 clks of output clk. By connecting slow clk to valid in you will violate that when clk is high since many fast clks will be enabled.

0 Kudos
Altera_Forum
Honored Contributor II
603 Views

OK. So I should set "valid in" set to "VCC" ? How about "clken", "reset_n" and "out_ready" ..... they should be connected to "VCC" too ?

0 Kudos
Altera_Forum
Honored Contributor II
603 Views

Again I don't know about your set-up and IP signals. But the role is 1:100. 

It is your responsibility to clk data in at 1/100 of output rate. Then it is the responsibility of CIC IP to give you the correct output.  

One way is this enable at a rate of 1/100, connect to valid_in: 

 

-- detect the edge of slow clk in the fast clk domain: 

 

wait until fast_clk = '1'; 

clk_1d <= clk_in; 

clk_2d <= clk_1d; 

 

enable <= clk_1d and not clk_2d; 

 

edit: make sure clks are synchronised
0 Kudos
Altera_Forum
Honored Contributor II
603 Views

Hello kaz !! 

Now the CIC-Filter is working!  

With detecting the edge of the slow clock and insert this to the Valid_In. 

Thank you very much! 

Tobias
0 Kudos
Altera_Forum
Honored Contributor II
603 Views

Hi tobias ,are you here ? I found your question about cic filter and is helpful to me, can you upload your worked design of cic filter quartus project here ? Thanks !

0 Kudos
Altera_Forum
Honored Contributor II
603 Views

Ok. I was thinking in your way too. Because the differentiators has to be clocked with the lower sample rate and the integrators has to be clocked with the higher rate. But I thought the CIC-Filter would do this "clocking" automatically. 

The CIC-Filter generated by the MegaWizard has only one clock-input.....how should I solve the problem??... 

 

 

 

___________________ 

Save your time and get on time success in a plus computer certification (http://www.pass4sure.co.uk/lx0-102.html) and testking toefl exams by using our latest comptia a+ (http://www.pass4sure.co.uk/lx0-101.html) and other superb n10-005 (http://www.pass4sure.co.uk/comptia-a-plus-training.html) pass resources of quincy university (https://www.faceboo.com/quincyuniversity) and southwestern college (http://www.youtube.com/user/southwesternccd)
0 Kudos
Altera_Forum
Honored Contributor II
603 Views

The CIC core has a streaming interface involving input and output valid signals rather than separate "clocks". The output rate will be in fact generated automatically with respect to the input rate. Review the documentation!

0 Kudos
Reply