0
\$\begingroup\$

I am using an FPGA to implement FIR filters, specifically for this question I have implemented a 12 point moving average filter. At the moment I am just using a signal generator as an input to the FPGA and putting in a pure sine wave at various frequencies. Now, my filter works as expected and has the expected frequency and phase response, however, in my output signal I see another sinusoid at around the clock frequency of the FPGA I am using. I have set the clock on the FPGA to be 40MHz and 10MHz and the sinusoid in the filtered signal occurred at around 40MHz and 10MHz respectively in these 2 cases so it is definitely proportional to the clock frequency.

I was wondering if someone could explain why this might be and what I could do to remove it? (I could use an analogue low pass filter after my filter to filter it out for example [although I'd prefer to remove it entirely since for my application low noise is ideal and adding more components will add noise])

I have uploaded a couple of youtube videos of what I see on the oscilloscope when I put in a sinusoidal signal generated by a signal generator (shown in yellow in the video) and what I see out of my FPGA filter (shown in blue).

Video 1 accompanying question for stackoverflow

Another interesting thing I observed, which may help in diagnosing what's going on, was that at certain frequencies this second signal disappears completely, in the following video the FPGA clock is set to 40MHz and I set the signal generator to generate 11MHz, 10Mhz and 9MHz sinusoidal waves. (The approximate frequency of the wave can be seen in the lower right of the screen) At 10MHz you can see that this high frequency signal seems to disappear. (this also coincides with a point of very high attenuation - the filtered signal is very flat)

Video 2 accompanying question for stackoverflow

If anyone has any suggestions of what might be causing this or how to get rid of it, it would be much appreciated.

Additional Info as requested: I'm using a NI 5781 as my ADC and DAC it has a 14 bit Input and 16 bit Output. Data sheet is linked here: ni.com/datasheet/pdf/en/ds-212.

I'm putting in a sinusoid that has 1V peak to peak and a 0.5V DC offset - i.e. a sine wave between 0V and 1V.

\$\endgroup\$
  • 2
    \$\begingroup\$ You need to tell us a lot more about your implementation. For example, what are you using for A/D and D/A converters? \$\endgroup\$ – Dave Tweed Aug 7 '16 at 14:19
  • \$\begingroup\$ Ahh, yes, sorry, I forgot about that as it's built into my setup. I'm using a NI 5781 as my ADC and DAC it has a 14 bit Input and 16 bit Output. Data sheet is linked here: ni.com/datasheet/pdf/en/ds-212 \$\endgroup\$ – SomeRandomPhysicist Aug 7 '16 at 15:18
  • \$\begingroup\$ I'm putting in a sinusoid that has 1V peak to peak and a 0.5V DC offset - i.e. a sine wave between 0V and 1V. \$\endgroup\$ – SomeRandomPhysicist Aug 7 '16 at 15:21
  • \$\begingroup\$ Please put the information about your system configuration in the question by editing your text. \$\endgroup\$ – user2943160 Aug 7 '16 at 17:58
  • \$\begingroup\$ Using an oscilloscope doesn't demonstrate much of anything about the performance of your system. You would need a spectrum analyzer to see what the actual spectral content is. What does your connection setup to the NI 5781 look like? \$\endgroup\$ – user2943160 Aug 7 '16 at 18:05
2
\$\begingroup\$

Signals accidentally propagate through adjacent pins and the PCB – that's called leakage, and more or less inevitable in circuits; you can reduce the amount of leakage by good PCB design, shielding and separation.

In the RF regions that your clock takes place, a rule of thumb is that if you've got more than 50 dB power suppression between harmonic signals carried on the same FR4 PCB, you're doing relatively well.

So, that explains you inevitably seeing the clock in your signal at all.

The question why you're not seeing it at 10 MHz is probably simple:

consider what a 40MHz clock is:

it's ideally a square wave with a period of 40 MHz. I trust you as random physicist know how deal with the Fourier transform, and can easily see that a perfectly periodic square wave signal has a discrete Fourier transform with dirac impulses of decreasing "amplitude" every 40 MHz.

The main frequency component you should be seeing is the 40 MHz tone itself. Now, that happens to be a harmonic of the 10 MHz signal, and the leakage of the clock into the ADC itself might lead to a "misobservation" of the input 10MHz as Input 10 MHz + 4. overtone – and your 12-tap filter just cancels out both, so that, if observed randomly at a "sweet phase spot", both are simultaneously cancelled out.

\$\endgroup\$
  • \$\begingroup\$ Thanks for your answer, I can see now why I might not be seeing this clock noise at 10MHz now and why I can see a sinusoid at the clock signal's frequency due to leakage from the local oscillator. How would one typically go about removing this from the output of a digital filter? Using a analogue high pass filter as I proposed in my question? \$\endgroup\$ – SomeRandomPhysicist Aug 8 '16 at 7:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.