signal processing - How to implement Overlap add method on Analog devices ADSP Bf70x -



signal processing - How to implement Overlap add method on Analog devices ADSP Bf70x -

i trying create sound fft convolution analog devices dsp , have utilize overlap add together method. can see source code bellow , still have problem on output sound it's saturation. tell me if doing wrong or if have illustration implement overlap add together method on analog devices dsp or documentation. thanks.

#include <filter.h> #include <fract2float_conv.h> #define fft_size 512 #define scale_method 1 #define samples_per_chan 256 complex_fract32 a_coeffsseg[512], w[512],complexsegmentleftin[512] ,complexsegmentrightin[512] ,complexsegmentleftout[512], complexsegmentrightout[512]; fract32 leftin [512], rightin [512]; int *block; // initialisation fft twidfftrad2_fr32(w, fft_size); //prepare coeffs for(i = 0; < samples_per_chan ; i++){ a_coeffs[i] = float_to_fr32(*(((float*) testcoefs) + i)); // coeffs } for(; < fft_size; i++){ a_coeffs[i] = 0x00000000; } rfft_fr32(a_coeffs, a_coeffsseg , w, 1, fft_size, &block, scale_method); /* , process overlap add together method */ = 0; (n = 0; n < samples_per_chan; n++){ leftin [n] = datain[i++]; rightin[n] = datain[i++]; } (; n < fft_size; n++){ leftin [n] = 0x00000000; rightin[n] = 0x00000000; } rfft_fr32(leftin , complexsegmentleftin , w, 1, fft_size, &block, scale_method); rfft_fr32(rightin, complexsegmentrightin, w, 1, fft_size, &block, scale_method); // complex_fract32 multiplication buffleft * a_coeffsseg , buffright * ( = 0; < fft_size; i++){ outl[i] = cmlt_fr32(complexsegmentleftin [i], a_coeffsseg [i]); } ( = 0; < fft_size; i++){ outr[i] = cmlt_fr32(complexsegmentrightin[i], a_coeffsseg [i]); } ifft_fr32(outl , complexsegmentleftout , w, 1, fft_size, &block, scale_method); ifft_fr32(outr, complexsegmentrightout, w, 1, fft_size, &block, scale_method); = 0; (n = 0; n < samples_per_chan; n++){ dataout[i++] = add_fr1x32( complexsegmentrightout[n].re, tmpright[n]); dataout[i++] = add_fr1x32( complexsegmentleftout [n].re, tmpleft [n]); } (n = 0; n < samples_per_chan; n++){ tmpright[n] = complexsegmentrightout[n].im; tmpleft [n] = complexsegmentleftout [n].im; }

signal-processing fft overlap convolution ifft

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -