element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Michael Kellett's Blog Digital Filtering
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: michaelkellett
  • Date Created: 18 Sep 2018 5:05 PM Date Created
  • Views 869 views
  • Likes 12 likes
  • Comments 4 comments
  • fpga
  • adc
  • filter
Related
Recommended

Digital Filtering

michaelkellett
michaelkellett
18 Sep 2018

I've just been testing a design that includes 8 hybrid (ie mixed analogue and digital) lock in amplifiers. They aren't, strictly speaking, lock in amps because they are synchronised to an internally generated signal which dives a laser. There are 8 detectors and the purpose of the filtering is to pass only signals which are at exactly the modulation frequency of the laser. (A true lock in amplifier would lock on to the signal without needing the internal reference - but it's mad to do that if you are generating the signal in the same box.)

 

Each of the 8 channels has broad band filtering and some switchable gain. The 8 channels are sampled by an 8 channel synchronous sampling  24 bit ADC which takes 240,000 samples per second per channel. The ADC is controlled by a Intel (was Altera) Cyclone 10 FPGA which also does most of the grunt work of the signal processing. It passes data via SPI (as 64 bit integers) to an STM32F407 which does a bit of averaging and scaling in floating point and presents data at quite a slow rate to the user interface.

 

The response of the analogue signal processing chain looks like this:

 

image

Plotted by the Picoscope 5444A.

 

And after the digital stuff has  done its magic:

 

image

 

Zoomed in a bit:

 

image

 

Amplitudes are in dB, 0dB is about 1.5uA at the system input.

 

The centre frequency isn't exactly at 10kHz, it's 5ppm off (or the Keysight signal generator is) , not too surprising since the filter only uses a 25ppm reference clock.

 

The complete system can work at any frequency from 1kHz to 20kHz.

 

This kind of digital filter is very easy to implement and very useful for measuring frequency responses or any other application where you are generating the test signal. If any one is interested I'll post a bit more about how it works and how to implement it on a micro (or FPGA).

 

MK

  • Sign in to reply

Top Comments

  • jpnbino
    jpnbino over 7 years ago +3
    Hi MK, When I know I need such a filter? Which parameters should I most care about? I think I need a get started thing in digital filtering application, most of the things I know is from the university…
  • shabaz
    shabaz over 7 years ago +3
    That's a very sharp passband : ) A cool use-case could be to implement some THD measurement tool maybe, by notching at 1kHz, and generating a 1kHz tone too, since you already mention you have the capability…
  • michaelkellett
    michaelkellett over 7 years ago in reply to shabaz +2
    I'll try to find time to post some implementation details of this kind of filter - I recently did one based on an ST ARM Cortex M4 processor with all the code in C - and I can publish some extracts of…
  • michaelkellett
    michaelkellett over 7 years ago in reply to shabaz

    I'll try to find time to post some implementation details of this kind of filter  - I recently did one based on an ST ARM Cortex M4  processor with all the code in C - and I can publish some extracts of that - probably much easier to follow (for most) than VHDL. Probably be a week or two before I get enough time.

     

    Adjustable filters in FPGA can be quite challenging - an approach I've often meant to try is to interpolate coefficients between pre-calculated sets. With FIR filters the worst that will happen is that you get a bad response, IIR filters may well go unstable.

    If your FPGA (or processor) has enough welly to do everything in floating point it's a lot easier to have on-the-fly-adjustable parametric filters. The STM32H750 might be a good chip for this - 400MHz, double precision floating point, 16 bit ADC and 12 bit on chip DAC. Of course for the programmable project it needs to be an FPGA.

     

    Here's a fun reference for a tune-able notch filter:

     

    https://www.academia.edu/11158434/FPGA_implementation_of_a_tunable_band-pass_filter_using_the_basic_heterodyne_block

     

    (Just found this one - it looks OK but I've not studied it in detail.)

     

    MK

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • michaelkellett
    michaelkellett over 7 years ago in reply to jpnbino

    The reason for using the filter in this application is that we are looking for a very small signal (about 1 - 100nA) from a photo diode and we want to be able to accurately measure the amplitude of that signal in the presence of broadband noise which may easily be 100x greater than the signal. So we modulate the light falling on the photo diode and make a filter that picks out just that frequency, here with a 3dB bandwidth of about 1Hz and a -80dB bandwidth of about 70Hz.

     

    The downside of such a filter is that it is very expensive to implement by purely analogue techniques. It's easy to digitally but does need an ADC and some kind of signal processing. At reasonable sampling rates you could use a micro (ARM Cortex with floating point probably good for 10k - 1000k samples per second with difficulty ranging from easy to quite tricky). For higher sample rates you'll need a dedicated DSP or an FPGA.

     

    The problem with very narrow band filters is their very slow response time - this one takes a few seconds to settle from a 40dB step change in input.

     

    MK

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 7 years ago

    That's a very sharp passband : ) A cool use-case could be to implement some THD measurement tool maybe, by notching at 1kHz, and generating a 1kHz tone too, since you already mention you have the capability to generate synchronised signals.

     

    Hehe I will be looking for a (simpler) project for the 'Path to Programmable' training completion, so I'd love to hear more, as would others for sure.

    Nowhere near this sophisticated (and not requiring 24bits either), I've always thought it would be a cool project to have some decent audio filter for ham radio. Something where you could dial up a desired high-pass and low-pass frequency, and also optionally notch out a tone.

    I think (I've never looked at any circuits) they probably do it with switched capacitor filter building-blocks today.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jpnbino
    jpnbino over 7 years ago

    Hi MK,

     

    When I know I need such a filter?

    Which parameters should I most care about?

     

    I think I need a get started thing in digital filtering application, most of the things I know is from the university ( theory ) nor a single lab.

     

    thanks,

    João Paulo Bino

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube