Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 791095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:46:53+00:00 2026-05-14T21:46:53+00:00

I’m trying to implement a DFT-based 8-band equalizer for the sole purpose of learning.

  • 0

I’m trying to implement a DFT-based 8-band equalizer for the sole purpose of learning. To prove that my DFT implementation works I fed an audio signal, analyzed it and then resynthesized it again with no modifications made to the frequency spectrum. So far so good.

I’m using the so-called ‘standard way of calculating the DFT’ which is by correlation. This method calculates the real and imaginary parts both N/2 + 1 samples in length. To attenuate a frequency I’m just doing:

float atnFactor = 0.6;
Re[k] *= atnFactor;
Im[k] *= atnFactor;

where ‘k’ is an index in the range 0 to N/2, but what I get after resynthesis is a slighty distorted signal, especially at low frequencies.

The input signal sample rate is 44.1 khz and since I just want a 8-band equalizer I’m feeding the DFT 16 samples at a time so I have 8 frequency bins to play with.

Can someone show me what I’m doing wrong? I tried to find info on this subject on the internet but couldn’t find any.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T21:46:54+00:00Added an answer on May 14, 2026 at 9:46 pm

    DFT and FFT are essentially the same for the purposes of this question.

    To attenuate a frequency bin (or “band”) in an FFT-transformed array, you need to multiply both the real and imaginary components by the same factor, and also multiply the real and imaginary components of the corresponding negative frequency bin. FFT produces a transformed pair of arrays where the first half of the values represent positive frequency components and the second half represents negative frequency components.

    Here is a simplified code sample for a low-pass filter that explains what I mean:

    // fftsize = size of fft window
    int halfFFTsize = fftsize / 2;
    float lowpassFreq1 = 1000.0;
    float lowpassFreq2 = 2000.0;
    for (int i = 0; i < halfFFTsize; i++)
    {
        int ineg = fftsize - 1 - i; // index of neg. freq.
        float freq = (float)i * (44100.0F / (float)halfFFTsize);
        if (freq >= lowpassFreq2)
        {
            real[i] = 0;
            imag[i] = 0;
            real[ineg] = 0;
            imag[ineg] = 0;
        }
        else if (freq >= lowpassFreq1)
        {
            float mult = 1.0 - ((freq - lowpassFreq1) / 
                (lowpassFreq2 - lowpassFreq1));
            real[i] *= mult;
            imag[i] *= mult;
            real[ineg] *= mult;
            imag[ineg] *= mult;
        }
    
    }
    

    Update: after reading your edit, I’d have to say your code is working as expected. I assumed you were getting a massively distorted re-synthesized signal, not a “slighty distorted signal, especially at low frequencies”.

    I think the distortion you’re seeing is the result of the very small window size you’re using – this would especially be the case if you’re not using a Hanning window approach to reconstruct the original signal.

    Try running your code with a more typical window size (like 1024). An 8-band equalizer doesn’t usually use an 8-bin FFT window. Typically, the settings of 8 sliders would be used to calculate a curvy function connecting the 8 points in the frequency domain, and this function would then be used to set the bin amplitudes for a much larger, more finely-grained set of frequencies.

    One more point, too: the frequency bins divide up the available range evenly, so no matter how big your window size is, more than half of the bins cover frequencies that aren’t audible to the human ear. This is why the bands covered by an equalizer are typically scaled logarithmically (e.g. 100Hz, 1Khz and 10Khz for a typical 3-band equalizer) and thus do not apply to equal numbers of frequency bins.

    In the case of an evenly-spaced 8 bin window, attenuation of 5 of the 8 is certain to have no audible effect other than distortion of the audible frequencies.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to loop through a bunch of documents I have to put
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.