Build your own noise shaping filters!, Freeware inside |
Build your own noise shaping filters!, Freeware inside |
Sep 4 2006, 09:55
Post
#1
|
|
![]() Group: Developer Posts: 1317 Joined: 20-March 04 From: Göttingen (DE) Member No.: 12875 |
Hi!
Inspired by this thread -- but also because I like messing around with DSP stuff from time to time .... I wrote two programs that let you design and apply noise shaping filters. Check out my little homepage (screenshot and ZIP to downlad). I'm kind of proud of the way poles and zeros are controlled. Havn't seen this approach before. Also, you get to hear the result instantly. Try altering the response while audio is on Cheers! Sebastian PS: I should probably mention that the noise you hear (program "iiirdsgn") is TPDF dithered silence. PPS: It's likely that you can design better noise shaping filters than those that are supplied. I didn't have accurate equal loudness data available. Filter design tips: - Try to keep the number of red and blue strings minimal - Keep the response below ... say +30 dB - Don't try to approximate equal loudness curves below, say, 1 kHz. If you do, the filters only get more complicated. There's hardly a gain due to the small bandwidth of that region. I intentionally use a linear frequency axis, so don't bother approximation the curves for a very small region. You may link to *.sos files you created if you think you've designed a really good one. This post has been edited by SebastianG: Sep 4 2006, 12:57 |
|
|
|
![]() |
Sep 29 2006, 16:12
Post
#2
|
|
![]() LAME developer Group: Developer Posts: 2950 Joined: 1-October 01 From: Nanterre, France Member No.: 138 |
For the beginners, here is an intro to the zeros/poles stuff in z-plane:
http://www.eumus.edu.uy/docentes/jure/docs...eBraindead.html |
|
|
|
Mar 5 2008, 11:03
Post
#3
|
|
![]() Group: Developer Posts: 1317 Joined: 20-March 04 From: Göttingen (DE) Member No.: 12875 |
I just thought you might be interested in a filter that I computed some time ago for 44kHz. This is what I did:
![]() CODE SOS FILE VERSION 1 size = 2x6 1.0 0.43661 0.43995 1.0 1.21968 0.67167 1.0 -1.58404 0.78993 1.0 -0.16099 -0.40768 # newly designed filter according to LAME's ATH curve # for a sampling frequency of 44100 Hz # max gain (limited) : +20 dB at 18-22 kHz # min gain : -23 dB at 3400 Hz Save the above text to "lameath44.sos" and the filter is ready to be used by REQUANT. Note: This filter is NOT compatible to IIIRDSGN. It has a pair of distinct real poles and IIIRDSGN only supports complex conjugate roots. IIIRDSGN will simply ignore 2nd order polynomials with distinct real roots, print out a warning and show you a different magnitude response. This given 2x6 matrix is in fact a MATLAB compatible second-order-section matrix. The corresponding numerator and denominator coefficients are [b,a]=sos2tf(sos_matrix): b = [1.0000 -1.1474 0.5383 -0.3520 0.3475]; % the numerator a = [1.0000 1.0587 0.0676 -0.6054 -0.2738]; % the denominator edit: In case your noise shaping implementation follows this popular signal flow graph and you require the coefficients b_h & a_h for H(z) then you need to derive these from the noise shaper's transfer function G(z) (given by b & a) like this: b_h = remove_leading_zero(a-b); a_h = a; due to the relationship G(z) = 1 - z^-1 H(z). So, for the above example b_h would be b_h = [2.20610 -0.47070 -0.25340 -0.62130]; For FIR filters this boils down to removing the leading one and negating the remaining coefficients. Cheers, SG This post has been edited by SebastianG: Mar 10 2008, 17:37 |
|
|
|
Mar 7 2008, 18:31
Post
#4
|
|
![]() Group: Developer Posts: 1317 Joined: 20-March 04 From: Göttingen (DE) Member No.: 12875 |
For those who are interested in using these filters on their own I'm sharing some demo code written for Matlab/Octave. The main file nsqdemo.m is a script that also contains some documentation and should be self-explanatory.
The algorithm is the same as the one used in IIIRDSGN and REQUANT internally: It uses chained 2nd-order sections in direct form II. The parameters needed to initialize the filter's state is a SOS-matrix that describes the noise shaper's transfer function G(z) directly -- not H(z) for G(z)=1 - z^-1 H(z). This is the SOS-matrix that's stored in the *.sos files (sometimes without 1st and 4th column which always contain ones). edit: Here's a 48 kHz version derived simply by frequency warping the 44kHz-filter from above: CODE SOS FILE VERSION 1 size = 2x6 1.0 0.29992 0.42952 1.0 1.12211 0.65184 1.0 -1.63432 0.80619 1.0 -0.21908 -0.39436 # newly designed filter according to LAME's ATH curve # for a sampling frequency of 48000 Hz # (frequency-warped version of the 44kHz filter) Save this to lameath48.sos and it's ready to be used by REQUANT. Enjoy! SG This post has been edited by SebastianG: Mar 11 2008, 08:54 |
|
|
|
SebastianG Build your own noise shaping filters! Sep 4 2006, 09:55
Ken S QUOTE (SebastianG @ Sep 4 2006, 09:55) I... Sep 4 2006, 19:18
d_headshot QUOTE (Ken S @ Sep 4 2006, 13:18) QUOTE (... Jun 24 2011, 23:08
Firon It seems to have clicking noises while typing or c... Sep 4 2006, 21:43
bhoar QUOTE (SebastianG @ Sep 4 2006, 04:55) Hi... Sep 5 2006, 07:32
SebastianG QUOTE (Ken S @ Sep 4 2006, 20:18) Very ve... Sep 5 2006, 09:48
bhoar QUOTE (SebastianG @ Sep 5 2006, 04:48) QU... Sep 5 2006, 14:30
cabbagerat Nice tool, thanks. Sep 5 2006, 10:47
Hollunder link works here too
Those questions could be stup... Sep 5 2006, 10:59
Firon QUOTE (SebastianG @ Sep 5 2006, 04:48)
I... Sep 5 2006, 11:41
Gabriel Dummy question:
In the transfert function, is z^{x... Sep 5 2006, 11:49
SebastianG QUOTE (Hollunder @ Sep 5 2006, 11:59) Tho... Sep 5 2006, 13:19
Hollunder Thank you sebastian, I found the thread you mentio... Sep 5 2006, 16:04
neelX QUOTE (SebastianG @ Sep 4 2006, 10:55) ..... Jan 16 2010, 14:33
lvqcl CODE This package is FREEWARE. You are allowed to ... Jan 16 2010, 15:24
neelX thank you lvqcl Jan 16 2010, 23:29
chjmartin2 I realize that this thread is relatively old, but ... Jun 24 2011, 14:21
Canar QUOTE (chjmartin2 @ Jun 24 2011, 06:21) M... Jun 25 2011, 01:32
zhuzengyou HellO:
The demo code is out of data,is any ... May 13 2012, 03:35![]() ![]() |
|
Lo-Fi Version | Time is now: 19th June 2013 - 02:00 |