Search code examples
matlabfiltersignal-processingspeechsynthesizer

Filter coefficients in matlab


I'm learning about signal processing and currently I have to do an speech synthesizer in Matlab. For emulate the resonator system of the mouth I've this transfer function:

R(z) = 1 - z ^(-1)

Can I implement this system with filter function in Matlab? I don't know how to extract the coeficients "a" and "b"...

Note: y = filter(b, a, x), where x is the input signal that we have to filter.

Thank you all!


Solution

  • Consulting the documentation for filter, you represent a transfer function as a rational function of coefficients such that:

    enter image description here

    The desired transfer function you want, Y(z) / X(z) = R(z) is equal to:

    R(z) = 1 - z^{-1}
    

    Here a(1) is implicitly equal to 1. Therefore, b(1) = 1 and b(2) = -1 referring to the above equation. All of the coefficients in the denominator are 0 except for a(1) which is equal to 1.

    As such, a = 1; b = [1 -1]; and so filtering your signal is simply:

    a = 1; b = [1 -1];
    y = filter(b, a, x);
    

    x is the signal of interest you want to filter.