Straightforward lowpass regularity feedback

Okay, so with any luck this isn't also tough or off-topic. Allow's claim I have a really straightforward lowpass filter (something that ravels a signal), and also the filter object has a placement variable and also a cutoff variable (in between 0 and also 1). In every action, a value is taken into the adhering to little pseudocode as "input": position = position*(1-c)+input*c, or even more mathematically, f(n) = f(n-1)*(1-c)+x[n]*c. The result is the value of "placement." Primarily, it relocates a percent of the range in between the existing placement and afterwards input value, shops this value inside, and also returns it as result. It's purposefully simplified, given that the task I'm utilizing this for is mosting likely to have means way too many of these in turn handling sound in actual time.

Offered the filter layout, just how do I construct a function that takes input regularity (where 1 suggests a sine wave with a wavelength of 2 examples, and also.5 suggests a sine wave with wavelength 4 examples, and also 0 is a level line), and also cutoff value (in between 1 and also 0, as revealed over) and also outputs the amplitude of the resulting sine wave? Sine wave can be found in, sine wave appears, I simply intend to have the ability to identify just how much quieter it goes to any kind of input and also cutoff regularity mix.

2019-05-06 01:06:17
Source Share
Answers: 2

I do not have adequate mojo to talk about Greg's solution.

  1. Greg made a foolish calculational blunder : The transfer function $A(\omega)$ need to be $c/(1-(1-c)e^{-i\omega})$.

  2. What you desire is the modulus of $A(\omega)$. Keep in mind that $\sin \omega n$ is specifically the fictional component of $e^{i\omega n}$. Due to the fact that the relationship in between input and also result is straight, the feedback to $\sin\omega n$ will certainly be the fictional component of $A(\omega)e^{i\omega n}$. That's mosting likely to be a sinusoid with some changing and also the amplitude $|A(\omega)|$. Here is a story for $c=1/2$.

  3. To find out more concerning this type of points, google "IIR filter" or "boundless impulse feedback".

2019-05-08 13:26:06

As I recognize it, you are offered a series $(x_n)_{n\in\mathbb{N}}$ of input values where you compute a series $f_n$ that is offered by the adhering to reappearance relationships :

$f_0 = 0$

$f_{n+1} = (1-c)f_n + c\cdot x_{n+1}$

Your inquiry is : offered a sine wave $x_n=\sin(\omega n)$, you insist that $f_n$ is additionally a sine wave and also you need to know its amplitude in dependancy on the regularity $\omega$.

Address : It's less complicated to compute the regularity feedback with rapid features as opposed to sine waves.

$f_n = Ae^{i\omega n}$

$x_n = e^{i\omega n}$

Since $f_{n+1} = e^{i\omega (n+1)} = e^{i\omega} e^{i\omega n} = e^{i\omega} f_n$, the reappearance relationship offers

$e^{i\omega} A e^{i\omega n} = (1-c)Ae^{i\omega n} + c e^{i\omega} e^{i\omega n}$

which indicates

$A(\omega) = \frac{c}{1 - (1-c)e^{-i\omega}}$

To compute the feedback for sine waves, you can stand for the sine function as a straight mix of 2 rapid features

$x_n = \sin(\omega n) = \frac1{2i}(e^{i\omega n}-e^{-i\omega n})$

and also get

$f_n = \frac1{2i}(A(\omega)e^{i\omega n}-\bar A(\omega)e^{-i\omega n}) = |A(\omega)| \sin(\omega n + \phi)$ where $A(\omega) =: |A(\omega)| e^{i\phi}$.

To put it simply, the intricate regularity feedback $A(\omega)$ inscribes both the adjustment in amplitude and also the stage change. I'll leave the specific estimation of $|A(\omega)|$ to you, to make sure that you can get accustomed to this method of estimation.

Without rapid features, you would certainly need to make use of the enhancement and also reduction theories for sine and also cosine. Place in different ways, rapid features give a really hassle-free solution of the trigonometric identifications.

2019-05-08 13:15:16