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

  • SEARCH
  • Home
  • 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 7978565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:31:29+00:00 2026-06-04T09:31:29+00:00

I’m working on a DSP class (obj-c++) for Novocaine , but my filters only

  • 0

I’m working on a DSP class (obj-c++) for Novocaine, but my filters only seem to cause noise/distortion on the signal.

I’ve posted my full code and coefficients here: https://gist.github.com/2702844
But it basically boils down to:

// Deinterleaving...
// DSP'ing one channel:
NVDSP *handleDSP = [[NVDSP alloc] init];
[handleDSP setSamplingRate:audioManager.samplingRate];
float cornerFrequency = 6000.0f;
float Q = 0.5f;
[handleDSP setHPF:cornerFrequency Q:Q];
[handleDSP applyFilter:audioData length:numFrames];

// DSP other channel in the same way
// Interleaving and sending to audio output (Novocaine block)

See the gist for full code/context.

The coefficients:

2012-05-15 17:54:18.858 nvdsp[700:16703] b0: 0.472029
2012-05-15 17:54:18.859 nvdsp[700:16703] b1: -0.944059
2012-05-15 17:54:18.860 nvdsp[700:16703] b2: 0.472029
2012-05-15 17:54:18.861 nvdsp[700:16703] a1: -0.748175
2012-05-15 17:54:18.861 nvdsp[700:16703] a2: 0.139942

(all divided by a0)

Since I presumed the coefficients are in the order of: { b0/a0, b1/a0, b2/a0, a1/a0, a2/a0 } (see: IIR coefficients for peaking EQ, how to pass them to vDSP_deq22?)

What is causing the distortion/noise (the filters don’t work)?

  • 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-06-04T09:31:31+00:00Added an answer on June 4, 2026 at 9:31 am

    Update: I recommend everyone to use my DSP class I released on github: https://github.com/bartolsthoorn/NVDSP It’ll probably save you quite some work.

    Got it working, woooo! Long live the japanese: http://objective-audio.jp/2008/02/biquad-filter.html

    The applyFilter method had to be:

    - (void) applyFilter: (float *)data frames:(NSUInteger)frames {
        /*
         The first two samples of data being passed to vDSP_deq22 have to be initialized from the previous call. So, you'd want to hold onto a float buffer and feed the tailing two samples after a vDSP_deq22 call back to the front of that array for the next time you call. (Alex Wiltschko)
         */
    
        // Thanks a lot to: http://objective-audio.jp/2008/02/biquad-filter.html
    
        // Provide buffer for processing
        float *tInputBuffer = (float*) malloc((frames + 2) * sizeof(float));
        float *tOutputBuffer = (float*) malloc((frames + 2) * sizeof(float));
    
        // Copy the data
        memcpy(tInputBuffer, gInputKeepBuffer, 2 * sizeof(float));
        memcpy(tOutputBuffer, gOutputKeepBuffer, 2 * sizeof(float));
        memcpy(&(tInputBuffer[2]), data, frames * sizeof(float));
    
        // Do the processing
        vDSP_deq22(tInputBuffer, 1, coefficients, tOutputBuffer, 1, frames);
    
        // Copy the data
        memcpy(data, tOutputBuffer, frames * sizeof(float));
        memcpy(gInputKeepBuffer, &(tInputBuffer[frames]), 2 * sizeof(float));
        memcpy(gOutputKeepBuffer, &(tOutputBuffer[frames]), 2 * sizeof(float));
    
        free(tInputBuffer);
        free(tOutputBuffer);
    }
    

    Full class: https://github.com/bartolsthoorn/NVDSP

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I want to count how many characters a certain string has in PHP, but
Seemingly simple, but I cannot find anything relevant on the web. What is the
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.

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.