Sign in

username:

password:



Not a member?

Search c6x



Search tips

Subscribe to c6x



c6x by Keywords

AD535 | BIOS | Booting | Bootloader | C621 | C6211 | C6415 | C671 | C6711 | C6711DSK | C6713 | CCS | Chassaing | COFF | DAT | DM64 | DM642 | DMA | DSK671 | DSK6711 | EDM | EDMA | EMIF | Emulator | EVM | EVM620 | FFT | FIR | GPIO | Halting | HPI | HWI | IDK | JTAG | LDB | LDH | LDW | Linker | LMS | LOG_printf | Matlab | McBSP | MEM_alloc | MIPS | PCI | PCM3003 | Pipeline | Profiling | QDM | Reset | ROM | RTDX | Sampling | SDRAM | Stack | TEB | THS1206 | TMS320C621 | TMS320C6416 | TMS320C6711 | TMS320C6713 | UART | Vector Table | XBUS | XDS560

Sponsor

Industry's highest performing at the lowest power DSPs now as low as $5.00*
Start development today!
*volume pricing for 10ku

Discussion Groups

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | TMS320C6x | FIR filter based on audio.c code

Technical discussions about the TI C6000 DSPs (including the c62x, c64x and c67x DSPs).

  

Post a new Thread

FIR filter based on audio.c code - seamusshovel - Mar 6 16:50:00 2002

I am doing a thesis on Active noise control using the C6701. The
first step of the project is to take TI's audio.c example code,
implement an FIR filter and then listen to the result. I have added
code to the 'processing' function and it compiles. However when I
run it and input a stream of audio samples the output is dominated by
noise...I have included the offending source code below. I am not
very familiar with this chip so I would appreciate hugely any help
especially if if you have attempted this problem before or if you
know of any working FIR code for the C6701...

cheers!

static Void process(Uns *src, Int size, Uns *dst)
{
int i;

for (i = size - 1; i >= 0; i--){

x[0] = (float)src[i]; //update most recent sample
sum = 0.0;

for (i=0; i<11; i++){
sum += (coef[i]*x[i]); //multiply sample by filter coef.s
} //coef[] and x[](storage array) are declared globally

dst[i]=(uns)sum; //let sample at destination = filtered sample

for (i=11; i>0; i--) //shift sample
x[i] = x[i-1];
}

/* if hostPipe is non-NULL write data to this pipe */
if (hostPipe != NULL) {
writeBuf(hostPipe, dst, size);
}
}




______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )

RE: FIR filter based on audio.c code - Hocquet Franck - Mar 7 12:08:00 2002

Hello,

I think that you have a C-programming problem instead
of a C6701 problem. You must use different variables
for your loops, unless it is happening whatever you did
not expected :
- first loop starts : (i=size-1),
- second loop starts : (i=0 !!!), so the first loop
will never work correctly...
I think that it is the reason why all you hear is noise.

Hope this helps.
Regards,
Franck
-----Original Message-----
From: seamusshovel [mailto:]
Sent: mercredi 6 mars 2002 17:50
To:
Subject: [c6x] FIR filter based on audio.c code I am doing a thesis on Active noise control using the C6701. The
first step of the project is to take TI's audio.c example code,
implement an FIR filter and then listen to the result. I have added
code to the 'processing' function and it compiles. However when I
run it and input a stream of audio samples the output is dominated by
noise...I have included the offending source code below. I am not
very familiar with this chip so I would appreciate hugely any help
especially if if you have attempted this problem before or if you
know of any working FIR code for the C6701...

cheers!

static Void process(Uns *src, Int size, Uns *dst)
{
int i;

for (i = size - 1; i >= 0; i--){

x[0] = (float)src[i]; //update most recent sample
sum = 0.0;

for (i=0; i<11; i++){
sum += (coef[i]*x[i]); //multiply sample by filter coef.s
} //coef[] and x[](storage array) are declared globally

dst[i]=(uns)sum; //let sample at destination = filtered sample

for (i=11; i>0; i--) //shift sample
x[i] = x[i-1];
}

/* if hostPipe is non-NULL write data to this pipe */
if (hostPipe != NULL) {
writeBuf(hostPipe, dst, size);
}
}

_____________________________________







(You need to be a member of c6x -- send a blank email to c6x-subscribe@yahoogroups.com )