Altera_Forum
Honored Contributor
16 years agoPre-Emphasis with IIR Filter
Hello!
I want to do a classic Pre-Emphasis with VHDL. Normally this is implemented with an IIR-Filter. I tried to do this in VHDL with the following formula I found in the web: y(i)=x(i)-(x(i-1)*k) . "k" is a factor between 0.95....0.97. When I do this the higher frequencies of an audio-signal have to rise in the magnitude. In my case only all frequencies are attenuated...what am I doing wrong?? Here is my code: beginif (rst = '0') then
xi := (others => '0');
xi1 := (others => '0');
yn_tmp := (others => '0');
yn_tmp2 := (others => '0');
b0_var := ("01100001"); --97
div := ("01100100"); --100
elsif (clk'event and clk = '1') then
x <= input;
yn_tmp := xi1 * b0_var;
yn_tmp2 := yn_tmp / div;
yn := resize(xi, yn_tmp2'length) - yn_tmp2;
output <= resize(yn, output'length);
xi1 := resize(yn, xi1'length);
xi := x;
end if; Thanks for your help! Tobias