Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

LPF doesn't work as supposed

DSP related issues, mathematics, processing and techniques

LPF doesn't work as supposed

Postby juha_tp » Sat Jun 06, 2020 7:18 am

1st order LPF implementation schematic can be found from here does not give correct response when exported to VST (VST Analyzer software). What I get are these responses:

LPF1_issue.png
LPF1_issue.png (40.71 KiB) Viewed 17744 times


(lower response after normalizing a0=1)
(NOTE: red curve is for high shelf filter )

Filter is designed using Octave:

Code: Select all
%% Butterworth LPF1 approximation for Linkwitz crossfeed use
%% fc @ 700Hz
function [b, a] = LR_crossfeed_LPF1(x)
% x = fs 
switch x
  case { 44100, 88200, 176400, 352800 }
    b(1) = -1.27962418247E-17*x^3+8.46647384248E-12*x^2-1.743160919708E-06*x+0.131910297106252;
    b(2) = b(1);
    a(1) = -1.63998176028E-17*x^3+1.089084487604E-11*x^2-2.2605860763131E-06*x+2.17451639264416;
    a(2) = -1.97934198689E-17*x^3+1.3055959391E-11*x^2-2.669817551786E-06*x-1.80141773027551;
  case { 48000, 96000, 192000, 384000 }
    b(1) = -9.12314114159E-18*x^3+6.56981379479E-12*x^2-1.472180284138E-06*x+0.121238164126997;
    b(2) = b(1);
    a(1) = -1.17911077076E-17*x^3+8.51964831143E-12*x^2-1.9232664955434E-06*x+2.16129807049821;
    a(2) = -1.40130321601E-17*x^3+1.00625912303E-11*x^2-2.240688152629E-06*x-1.81838475852698;
  otherwise % other fs ... do nothing
    b = [1 0 ];
    a = [1 0 ];
endswitch

endfunction


and it gives this response in Octave (and in all other software I've tested so far):

lpf1.png
lpf1.png (16.02 KiB) Viewed 17727 times


(green = target response, blue thin -- = BLT version, Earlevel plot https://i.postimg.cc/j27DLqVg/earlevel-LPF1.png)

In comparison, 1st order high shelf filter implementation there in plot and schematic gives same response on both software.

Any suggestions on possible culprits for the issue?
Attachments
responses.png
responses.png (20.83 KiB) Viewed 17744 times
Last edited by juha_tp on Fri Jun 12, 2020 6:23 am, edited 1 time in total.
juha_tp
 
Posts: 60
Joined: Fri Nov 09, 2018 10:37 pm

Re: LPF doesn't work as supposed

Postby martinvicanek » Sat Jun 06, 2020 4:45 pm

Check your coefficients. In the Ruby box you have the suspicious line

a21 = a20/a20

which could be a typo.
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: LPF doesn't work as supposed

Postby juha_tp » Sat Jun 06, 2020 5:37 pm

Hmm... I think it's OK that way (I don't have access to schematic ATM so I can't check if all coefficients are divided by a20 there) ... meaning as a21 = a20 and you scale by a20 then a21 = 1 (i.e. a21=a20/a20) ... actually, this can be checked with attached Octave listing as well if you scale by b(1) there it results following coefficients:
Code: Select all
a = [ 1   1 ]
b= [ 29.7506663062669  -26.9222391815198 ]


which are OK as seen in plot: https://i.postimg.cc/4NhvmXwC/lpf-earlevel.png
juha_tp
 
Posts: 60
Joined: Fri Nov 09, 2018 10:37 pm

Re: LPF doesn't work as supposed

Postby martinvicanek » Sat Jun 06, 2020 6:39 pm

The instruction a21 = a20/a20 looked weird to me, but if a21 = 1 is correct then you have a pole at z = -1. That means your filter rings with Nyquist frequency forever! For a stable filter all poles must lie inside the unit circle on the z-plane. Maybe you have the a and b coefficients interchanged?
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: LPF doesn't work as supposed

Postby juha_tp » Sat Jun 06, 2020 7:23 pm

Thanks,
probably it's related to what you suggest because of I can replicate that mirrored response (showing in my 1st post image) by swapping a and b... but, IIRC, I tried swapping coefficients earlier in FS code and the result was not OK in VST analyzer (actually no response at all (checked from -3000dB...3000dB range) so maybe it resulted a blown filter then). (NOTE: I'm running FS on 64-bit W10 ... and also VST Analyzer is an old 32-bit software now running in same PC so maybe something is not fully trusty anymore...).

So, I'll have to re-try by swapping the coefficients in FS ... .
juha_tp
 
Posts: 60
Joined: Fri Nov 09, 2018 10:37 pm

Re: LPF doesn't work as supposed

Postby adamszabo » Sun Jun 07, 2020 9:07 am

You dont have to use vst analyzer, you can have an impulse as your input, and connect the filter output to a transfer function windows and you can see the same graph live in FlowStone
adamszabo
 
Posts: 667
Joined: Sun Jul 11, 2010 7:21 am

Re: LPF doesn't work as supposed

Postby juha_tp » Tue Jun 09, 2020 5:05 pm

OK, got the LPF working by swapping coefficients as MV suggested.
juha_tp
 
Posts: 60
Joined: Fri Nov 09, 2018 10:37 pm


Return to DSP

Who is online

Users browsing this forum: No registered users and 56 guests