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
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Embedded Forum Implementing a digital Filter
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 13 replies
  • Answers 8 answers
  • Subscribers 477 subscribers
  • Views 1802 views
  • Users 0 members are here
Related

Implementing a digital Filter

farcane
farcane over 8 years ago

Hallo Guys,

 

I want to implement a digital filter using an Atmega16 Microcontroller, I am getting the Input signal from an 8 bit  ADC "AD9057" to  the Atmega 16  "port C" then I converted my input signal to ASCii Characters ( 0-128)  which are displayed in my Terminal every 1 second , but there is some noise in my output signal and I want to get rid of it, so I want to use a digital filter for this purpose, but I am confused which digital filter may I implement  to get the desired result.

 

just to give you an example:

 

When I apply a constant voltage to my  ADC analog input; I expect a  single digital output representation. but I am getting a range of data.

 

like when I apply 2 V I get a digital output  (0 - 3)

                           2.2 V I get ( 40- 44)

                           2.3 V I get ( 65-70)

                           2.5 V I get ( 118-124)

 

And in each case the desiried output should be just one value " a single digital output representation, lets say the average  " and not a range of data.

 

Any ideas for this issue?

 

regards

Imed

  • Sign in to reply
  • Cancel

Top Replies

  • manlong
    manlong over 8 years ago in reply to farcane +1 suggested
    Imed, First I think you have to add an anti-aliasing filter at the input of your ADC. The cuttoff frequency should be twice as high as the signal frequency. Regards Man Long
  • manlong
    manlong over 8 years ago in reply to michaelkellett +1 suggested
    When you input to an ADC you have to put before an anti aliasing filter. The aim is to reduce the noise. Even you want to measure DC signal. You have to filter and delete all signal above DC. The ADC acquire…
  • michaelkellett
    michaelkellett over 8 years ago in reply to manlong +1 suggested
    @ Man Long Lay I'm sorry but this is NOT the function of an anti-alias filter. The clue is in the name - an anti-alias filter is a low pass filter placed before the ADC to stop frequencies above one half…
Parents
  • manlong
    0 manlong over 8 years ago

    Hello,

    Could you tell me how you apply a constant voltage?

    Is it a sensor? a power supply? a voltage divider?

    If you constant voltage is not constant because of noise, it is normal you have some bit variation.

    Your component have also a noise conversion that generate noise at the output which can varie about 1 bit to 2 bit.

    Regards

    Man Long

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • farcane
    0 farcane over 8 years ago in reply to manlong

    Hello Man Long,

     

    Thanks for your reply, I am applying a constant voltage from a potentiometer( 0 to +0.5V) throught an inverting amplifier ( AD8041)  which yields an output of ( 2.5V - 2V ) respectively; which is directly connected to the ADC analog input.

     

    Yes you are right that can be the reason why I am getting a range of output digital representation, but how do you think may I implement a digital filter in this case ? should I change the source of the analog input ? knowing that my ADC ( AD9057)  works only with an analag input of 1V pp and its related to the ADC reference voltage, which is in my case 2.5V,  so the analog input range is between ( 2- 3V), have a look at the ADC data sheet page 4 http://www.analog.com/media/en/technical-documentation/data-sheets/AD9057.pdf

     

    regards

    Imed

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • manlong
    0 manlong over 8 years ago in reply to farcane

    Imed,

    First I think you have to add an anti-aliasing filter at the input of your ADC.

    The cuttoff frequency should be twice as high as the signal frequency.

    Regards

    Man Long
    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • michaelkellett
    0 michaelkellett over 8 years ago in reply to manlong

    @ Man Lomg Lay

    If Imed is measuring DC then an anti aliasing filter will make no difference at all.

     

    @Imed,

     

    Your ADC looks very very noisy, much worse than it should be.

    You are using a fast ADC and I think from my recollection of your pcb you don't have very good ground planes (I think none at all) - this may hurt at fast sampling rates.

    Check the noise on your power supplies to the ADC using a scope and possibly increase the values of any decoupling capacitors.

    Check the noise on the ADC input if your scope is good enough - you should be looking for peak - peak noise less than 4mV.

     

    When you get the noise to a reasonable level I can help you with a digital filter, but I would need to know the sampling rate and the bandwidth of the signals you want to measure.

     

    MK

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • manlong
    0 manlong over 8 years ago in reply to michaelkellett

    When you input to an ADC you have to put before an anti aliasing filter.

    The aim is to reduce the noise. Even you want to measure DC signal.

    You have to filter and delete all signal above DC.

    The ADC acquire all signal between DC to 120MHz. If you want only DC signal you have to cutoff the signal above DC.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • farcane
    0 farcane over 8 years ago in reply to michaelkellett

    Hello Michael,

     

    which ADC noise do you mean? because I solved the problem that I told you about before, and now I am getting a reasonble digital output range of 4 to 5 Bits difference only, so for example if I apply 2V to AIN of my ADC I get ( 0-3 ) digital output converted to ASCII, and if I apply 2.2V to AIN I get (40-44), for 2.5V I get (120- 125) knowing that my reference voltage is exactly 2.52V, so I think my ADC is not so noisy and that digital output bits difference is due to a small alternance of 10mV  in the AIN voltage because as you know this voltage is coming from an inverting amplifer output.

    The sampling frequency of my Analog signal is 5MHz, so what kind of digital Filter may I implement with an Atmega16  please ?

     

    Best regards

    Imed Oussalah

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • farcane
    0 farcane over 8 years ago in reply to michaelkellett

    Hello Michael,

     

    which ADC noise do you mean? because I solved the problem that I told you about before, and now I am getting a reasonble digital output range of 4 to 5 Bits difference only, so for example if I apply 2V to AIN of my ADC I get ( 0-3 ) digital output converted to ASCII, and if I apply 2.2V to AIN I get (40-44), for 2.5V I get (120- 125) knowing that my reference voltage is exactly 2.52V, so I think my ADC is not so noisy and that digital output bits difference is due to a small alternance of 10mV  in the AIN voltage because as you know this voltage is coming from an inverting amplifer output.

    The sampling frequency of my Analog signal is 5MHz, so what kind of digital Filter may I implement with an Atmega16  please ?

     

    Best regards

    Imed Oussalah

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Children
No Data
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