This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Help with audio codec

Hi,

I have two questions:

1- If I want to use the audio codec through a poll instead of with intr and my fir filter uses intr functions, can I have two vectors activated at the same time on my project? One vector poll for the audio codec and another intr vector for the fir filter.

2- I want to DAC_ATTEN of the audio codec constantly, how could I do it? Because I tried to use this:
 output_sample(buffer[inbuf_ptr]); And I change the values of the array by multiplying them with a number between 0 and 1. But the output audio makes a lot of noise, and I don't get what I want. Any idea?

Also, I've tried to use this code, but I don't know how to set it as a low pass filter with a certain cut-off frequency, neither the coefficients.

float x[N]; // filter delay line

float h[N] = {
2.0000E-001,2.0000E-001,2.0000E-001,2.0000E-001,2.0000E-001
};

interrupt void interrupt4(void)
{
  short i;
  float yn = 0.0;

  x[0] = (float)(input_left_sample()); // input from ADC
  for (i=0 ; i<N ; i++)                // compute filter output
    yn += h[i]*x[i];
  for (i=(N-1) ; i>0 ; i--)            // shift delay line
    x[i] = x[i-1];
  output_left_sample((uint16_t)(yn));  // output to DAC
  return;
}

Best regards,

Miguel.