Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

FIR Compiler Strange Output

I've just added an FIR Compiler to my design, for use as an antialiasing filter. The sampling frequency is 6.25kHz, and low-pass filter cutoff is 3kHz.

I've run a test signal through; a pure sine wave of 1kHz, but I'm getting a really bizarre output (images attached). Surely the output should be that same sine wave? Or is my understanding of FIR filters completely wrong?

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I have a few questions.

    1. What is your input set to? signed or unsigned?

    2. What is your output set to? signed or unsigned?

    3. What clock rate are you running?

    4. Are you doing any decimation or multichannel?

    /Boris
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Boris,

    1. Signed Binary input

    2. UNSURE, I can't see anywhere in the Megafunction Parameters to explicitly define the output

    3. Clocked at 6.25kHz (Sampling Rate)

    4. No decimation or multichannel as far as I'm aware.

    I've attached screencaps of the Paramaters and Coefficients, for you to read at your leisure
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Try to use the 12 MSBs in your output. It looks like you are truncating the 8 MSBs right now. Also please try to run a clock rate a bit higher than the sample rate. That way you will have a bit better margins.

    /Boris
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I simulated a fir based on the settings you showed in your screen captures and indeed the output format is the problem. You need to take the 12 MSBs.