element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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
Op-Amp-a-Palooza
  • Challenges & Projects
  • Project14
  • Op-Amp-a-Palooza
  • More
  • Cancel
Op-Amp-a-Palooza
Blog LED Music visualizer - Blog 1
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Op-Amp-a-Palooza to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: rsjawale24
  • Date Created: 5 Apr 2022 5:36 PM Date Created
  • Views 2067 views
  • Likes 10 likes
  • Comments 4 comments
  • opampsch
  • opamps
  • project14
  • filters
Related
Recommended

LED Music visualizer - Blog 1

rsjawale24
rsjawale24
5 Apr 2022

Introduction                                

Hello everyone! Welcome to the first blog of my project14 entry -  A LED music visualizer. Since this project is going to be a large one, I'm dividing it into multiple blogs. The first blog will introduce the project and give a basic block diagram of the project as well as talk a little about different types of filters. Then in the next blog, I will implement the filters and do the testing of the project. To reduce the size of the overall project I will be using SMD components and hence the last blog will be the PCB design and the final implementation of the project.

Opamps are quite versatile components in electronics. You can do pretty much everything using an opamp - Amplifiers, filters, detectors, rectifiers. You can also do various mathematical operations such as summing, difference, squaring, square root, log, anti-log, etc using opamps. This is what makes them special in analog electronics. You can make a simple analog calculator using opamps!!!

I remember reading a book on opamps by Sergio Franco, I believe this book is a standard one and is used in universities all over the world. The author in the preface of the book writes - "If you cannot do it in digital, it's got to be done in analog."

So in this project, I'm going to design a LED music visualizer using opamp filters. I will be using active filters for this. An active filter is a filter that uses an active element such as a transistor or an opamp so that it can provide gain in the passband while attenuating the stopband.

Here's the basic block diagram of the project -

image

The audio spectrum consists of frequencies from 20 Hz to 20 kHz which is derived from the human audible range. Any good-quality speakers can produce all these frequencies and give a good sound experience. In this project, the input audio signal is divided into 3 frequency bands - The lower band, the mid-band, and the higher band. The lower band frequencies are often called bass, the mid-band is usually vocals since the voice frequencies of the human fall between 1kHz - 4kHz, and the higher frequencies are called treble.

In this project, the input signal is divided into these three bands using appropriate filters and then the output of these filters is fed to LEDs. These LEDs will respond to the audio signals and light up accordingly. This is the basic idea of the music visualizer.

Filter Basics                               

Here, I will give a basic introduction about filters. A filter is a frequency selective circuit, meaning that it behaves differently for different frequencies and its transfer function is dependent on the input frequency of the signal.

The filters shown below are all passive filters, meaning that there is no active element involved and all filters have 0 dB (unity) gain in the passband.

The first one is the RC low pass filter (LPF) -

A low pass filter is one that allows frequencies below the cutoff to pass (passband) and attenuates the frequencies above the cutoff freq. A simple RC filter is simulated using LTspice and the results are shown below -

The RC filter has a cutoff freq given by the formula

fc = 1/(2*pi*R*C)
For the filter below, fc = 48.2 kHz. The same can be observed from the gain vs frequency plots of the simulated results. The cutoff freq is where the gain drops by 3dB i.e. -3db for a passive filter with a gain of 0dB

image

image

The cutoff from the simulation is 42.22 kHz very close to the mathematical value.

Next is a high pass filter (HPF), a HPF attenuates the frequencies below the cutoff and allows the frequencies above the cutoff, which means the filter response is exactly the opposite of LPF.

The below circuit is an example for RC HPF along with the simulated results. One thing to note here is that the formula to calculate the cutoff freq remains the same, only the passband and stopband get exchanged. The positions of the R and C are exchanged to form an HPF from LPF with the same cutoff freq.

image

image

Here in the gain vs freq plot, it can be observed that the gain is less in the stopband and the gain increases as the freq increases. Beyond the cutoff, the gain increases and reaches to 0dB.

The last filter which I'll be using is the bandpass filter. As the name suggests, a bandpass filter (BPF) allows only a certain band of frequencies to pass through them while blocking all the out-of-band frequencies. A BPF can be formed by combining the HPF and LPF with two different cutoffs. The first stage of the BPF is an HPF such that it allows all the frequencies above f1 and the second stage is an LFP which blocks all the frequencies below f2 such that f2 > f1. 

Below is an example of a BPF along with its gain vs freq plot.

image

image

As seen above, the gain first increases and then again starts to decrease with an increase in frequency. The gain is maxed in the middle band of the cutoff frequencies.

All the filters above, are passive in nature and have no gain at all. Just for an example, I have also simulated an active filter using opamp which provides a certain amount of gain in the passband. This is helpful if you want to drive a load or feed the output signal of a filter to another stage. With no gain, the filtered output is of not much use.

image

In the above circuit, the low pass filter has a cutoff freq of 1.59 kHz and the filtered signal is fed at the input of a non-inverting opamp amplifier to amplify the signal. From the gain vs freq plot, it can be observed that the cutoff of the signal remains the same but the max gain has improved by a factor of 2 or 6 dB.

image

Now that we have built upon the basics of filters and active filters using opamps, it's time to do some calculations for our required filters and test the circuit.

In the next blog, I will test each filter separately and then combine all the filters to build the entire project.

  • Sign in to reply
Parents
  • beacon_dave
    beacon_dave over 3 years ago

    Nice blog but I think there may be a typo and also a slight error in the band pass filter section ? 

    "...The first stage of the BPF is an HPF such that it allows all the frequencies above f1 and the second stage is an LFP which blocks all the frequencies below f2 such that f2 > f1..."

    'LFP' should perhaps be 'LPF' ?

    The second stage low pass filter would presumably block all the frequencies above f2 and not below it ?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • beacon_dave
    beacon_dave over 3 years ago

    Nice blog but I think there may be a typo and also a slight error in the band pass filter section ? 

    "...The first stage of the BPF is an HPF such that it allows all the frequencies above f1 and the second stage is an LFP which blocks all the frequencies below f2 such that f2 > f1..."

    'LFP' should perhaps be 'LPF' ?

    The second stage low pass filter would presumably block all the frequencies above f2 and not below it ?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • rsjawale24
    rsjawale24 over 3 years ago in reply to beacon_dave

    Thanks for the corrections! I'll edit the blog soon.

    • Cancel
    • Vote Up 0 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