Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Fir filter help me to convert into c++

Status
Not open for further replies.

Darwin1234

Newbie level 3
Joined
Jun 30, 2014
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
72
Hi guys,

I read this thread because i believe the guys here will help me :p):p;-)
i am trying to make a flanger effects.
**broken link removed** or you can check here.
https://sound.eti.pg.gda.pl/student/eim/synteza/adamx/eindex.html

and according to the site flanger should be like this

The difference equation is y(n)=x(n)+ax(n-D(n)), where, for example D(n)=d/2(1-cos(2pFn)), F - deviation speed (about 1 Hz), d - deviation rate.
The modulation of delay time causes dynamic changes in dips and peaks position. Additional effect is time stretching of audio signal. The time delay varies between 1 and 5 ms. Alike echo there is FIR and IIR version.

so now my question. how can i convert the formula to c++?
y(n)=x(n)+ax(n-D(n)), where, for example D(n)=d/2(1-cos(2pFn)),

everyone?


thanks in advance! :)
 

Try to understand Pic.2 in the article and consider how it can be implemented in a processor. Hint: the variable delay line is usually realized as a ring buffer. Start with a fixed delay y(n)=x(n)+ax(n-b) (similar to an echo) and if it works design the modulation.
 

Hi FvM,

thank you for the information, i know about the circullar buffer or ring buffer. i have code it like this

check my code.
Code:
cbuffer[echooffset]=input*0.5;// original *  ( amount of original )
            if (echooffset++>=ECHO-1)echooffset=0;
            ouput+=cbuffer[echooffsetplay]*0.4;// amount to mix into dry
            if (echooffsetplay++>=ECHO-1)echooffsetplay=0;
}

but i want to know how to implement the LFO. which is implement by flanger.

(n)=x(n)+ax(n-D(n)), where, for example D(n)=d/2(1-cos(2pFn)), F - deviation speed (about 1 Hz), d - deviation rate.
 
Last edited by a moderator:

Hi sorry for late response. i would like to know how we can implement the sinewave LFO on my codes.

cbuffer[echooffset]=input*0.5;// original * ( amount of original )
if (echooffset++>=ECHO-1)echooffset=0;
ouput+=cbuffer[echooffsetplay]*0.4;// amount to mix into dry
if (echooffsetplay++>=ECHO-1)echooffsetplay=0;
}

where to put the sinewave?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top