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 6828493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:23:23+00:00 2026-05-26T22:23:23+00:00

The DSP board I am currently using is DSK6416 from Spectrum Digital, and I

  • 0

The DSP board I am currently using is DSK6416 from Spectrum Digital, and I am implementing a convolution algorithm in C to convolve input voice samples with a pre-recorded impulse response array. The objective is to speak into the microphone, and output the processed effect so we sound like we are speaking in that environment where the impulse response array is obtained.

The challenge I am facing now is doing the convolution live and keep up the pace of the input and output speed of the interrupt function at 8 kHz.

Here is my brain storming idea:

My current inefficient implementation that does not work is as follows:

The interrupt will stop the convolution process, output the index, and resume convolution at 8 kHz, or 1/8kHz seconds.

However, a complete iteration of convolution runs much slower than 1/8kHz seconds. So when the interrupt wants to output the data from the output array, the data is not ready yet.

My ideal implementation for fast pipelining convolution algorithm:

We would have many convolution processes running in the background while outputting the completed ones as time goes on. There will be many pipes running in parallel.

If I use the pipelining approach, we would need to have N = 10000 pipeline processes running in the background…

Now I have the idea down (at least I think I do, I might be wrong), I have no clue how to implement this on the DSK board using C programming language because C does not support object orientation.

The following is the pseudo-code for our C implementation:

#include <stdio.h>
#include "DSK6416_AIC23.h"
Uint32 fs=DSK6416_AIC23_FREQ_48KHZ;        //set sampling rate
#define DSK6416_AIC23_INPUT_MIC 0x0015
#define DSK6416_AIC23_INPUT_LINE 0x0011
Uint16 inputsource=DSK6416_AIC23_INPUT_MIC; // select input

//input & output parameters declaration
#define MAX_SIZE 10000
Uint32 curr_input;
Int16 curr_input2;
short input[1];
short impulse[MAX_SIZE ];
short output[MAX_SIZE ];
Int16 curr_output;

//counters declaration
Uint32 a, b, c, d;      //dip switch counters
int i, j, k;            //convolution iterations
int x;                  //counter for initializing output;                                     

interrupt void c_int11()         //interrupt running at 8 kHz
{
    //Reads Input
    //Start new pipe
    //Outputs output to speaker
}

void main()
{

//Read Impulse.txt into impulse array

    comm_intr();
    while(1)
    {

    if (DIP switch pressed)
    {
            //convolution here (our current inefficient convolution algorithm)
            //Need to run multiple of the same process in the background in parallel.

    for (int k = 0; k < MAX_SIZE; k++)
    {
        if (k==MAX_SIZE-1 && i == 0)  // special condition overwriting element at i = MAX_SIZE -1
        {
            output[k] = (impulse[k]*input[0]); 
        }
        else if (k+i < MAX_SIZE) // convolution from i to MAX_SIZE
        {
            output[k+i] += (impulse[k]*input[0]); 
        }

        else if (k+i-MAX_SIZE != i-1)  // convolution from 0 to i-2
        {
            output[k+i-MAX_SIZE] += (impulse[k]*input[0]); 
        }
        else   // overwrite element at i-1
        {
            output[i-1] = (impulse[k]*input[0]); 
        }
    }

    }

    else //if DIP switch is not pressed
    {
            DSK6416_LED_off(0);
            DSK6416_LED_off(1);
            DSK6416_LED_off(2);
            DSK6416_LED_off(3);
            j = 0; 
            curr_output = input[1];
            output_sample(curr_output);  //outputs unprocessed dry voice
    }
    } //end of while
    fclose(fp);
}

Is there a way to implement pipeline in C code to compile on the hardware DSP board so we can run multiple convolution iterations in the background all at the same time?

I drew some pictures, but I am new to this board so I can’t post images.

Please let me know if you need my pictorial ideas to help you help me~

Any help on how to implement this code is very much appreciated !!

  • 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-26T22:23:24+00:00Added an answer on May 26, 2026 at 10:23 pm

    You probably need to process data in chunks of some N samples. While one chunk is being I/O’d in an DAC/ADC interrupt handler, another one is being processed somewhere in main(). The main thing here is to make sure your processing of a chunk of N samples takes less time than receiving/transmitting N samples.

    Here’s what it may look like in time (all things in every step (except step 1) happen “in parallel”):

    1. buf1=buf3=zeroes, buf2=anything
    2. ISR: DAC sends buf1, ADC receives buf2; main(): processes buf3
    3. ISR: DAC sends buf3, ADC receives buf1; main(): processes buf2
    4. ISR: DAC sends buf2, ADC receives buf3; main(): processes buf1

    Repeat indefinitely from step 2.

    Also, you may want to implement your convolution in assembly for extra speed. I’d look at some TI app notes or what not for an implementation. Perhaps it’s available in some library too.

    You may also consider doing convolution via Fast Fourier Transform.

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

Sidebar

Related Questions

I am working on implementing BFSK algorithm on a DSP processor and need to
Our app uses the remoteIO (audio-unit) to get audio input from mic, and DSP
I'm using a DSP to control a sensorless brushless DC motor, The DSP is
I am currently trying to optimize some DSP related code with Shark and found
I'm trying to build a Win32 DLL from an audio-DSP related Linux library (
I am currently prototyping some algorithms in Matlab that rely on matrix, DSP, statistics
I am currently working on my project wherein I need to program a DSP
I've got a question about coding an algorithm for a Texas Instruments TMS320C64xx DSP
I'm doing real-time DSP on Silverlight microphone input in order to show a volume
I am currently working on an audio DSP App development. The project requires direct

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.