Project: Filter Calculator for Convolution

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jdc0589
    Member
    • Dec 2008
    • 32

    Project: Filter Calculator for Convolution

    I put this in the PE forums as well.

    Background:
    Some of you may remember my 3-CR Full Range project where I created a filter in REW and used a convolution plugin with Foobar audio player to implement it.

    For those of you that don't know, convolution is similar to an 'infinite' point EQ. My project was a full range one, so I took measurements with NO signal manipulation of any kind from physical components (notch filters, bsc, etc..) or from an EQ. From those raw measurements, which generate a standard frequency response graph (an ugly one), you calculate the opposing curve that would balance your F/R. The opposing curve is used in the convolution process to generate flat frequency response.

    New Stuff:
    The automatic calculation functions in REW....suck. They are limited in the frequency range in which they work and how many peaks/valleys can be addressed. So, last week I wrote a utility that reads raw frequency response data from a text file, calculates the target Db level, generates the opposing curve, and saves the data to another text file. It needs some more work in regard to target Db calculation/optimization and point density in relation to efficiency, but the initial results look pretty good.

    My goal is to expand the utility over this comming summer to output the final .wav file used by convolver plugins so no extra software/step is required before the output is ready for convolution.
    All code is in Java, so it will be able to run on pretty much any platform, regardless of operating system. If you have any interest or knowledge in this type of signal processing, please let me know, Im learning as I go here.


    Thanks for looking! If I can keep developing and testing the program to the point I am completely satisfied with it, I will provide anyone interested with a copy.

    Post any questions or comments!
  • JonMarsh
    Mad Max Moderator
    • Aug 2000
    • 15290

    #2
    very interesting- not something I have background knowledge in, but something I may have need of in the next few months- what would be interesting is also having a tabular output of the correction equalization- poles and zeros and levels.
    the AudioWorx
    Natalie P
    M8ta
    Modula Neo DCC
    Modula MT XE
    Modula Xtreme
    Isiris
    Wavecor Ardent

    SMJ
    Minerva Monitor
    Calliope
    Ardent D

    In Development...
    Isiris Mk II updates- in final test stage!
    Obi-Wan
    Saint-Saƫns Symphonique/AKA SMJ-40
    Modula PWB
    Calliope CC Supreme
    Natalie P Ultra
    Natalie P Supreme
    Janus BP1 Sub


    Resistance is not futile, it is Volts divided by Amperes...
    Just ask Mr. Ohm....

    Comment

    • jdc0589
      Member
      • Dec 2008
      • 32

      #3
      Originally posted by JonMarsh
      very interesting- not something I have background knowledge in, but something I may have need of in the next few months- what would be interesting is also having a tabular output of the correction equalization- poles and zeros and levels.
      It would be very simple to add the ability for it to output the +/- Db value at each of the measurement points


      Also, If anyone has FR data from a project in text form, I could really use some more test data. Optimally this data would have been taken WITHOUT any signal filtering (via physical passive filters or eq), IE: it would look nastier than the result you got after implementing filter networks. If it was a multi-way project, obviously its ok if the crossover (without any filters) was in place during measurements.

      In addition, if you have F/R data for a finished project (with passive filter networks implemented in the crossover) and just want to see what the difference would be with convolution applied on top of your passive stuff, I'll run it for you and post a graph :T .

      Comment

      • Hank
        Super Senior Member
        • Jul 2002
        • 1345

        #4
        This sounds interesting (and over my head, but I would be interested in the end result). Mark "The Kid" my have knowledge you are seeking. I'll ping him. I assume this could work for someone to determine the numbers for somethink like, oh, say, an open baffle line array with digital filters? :W

        Comment

        • jdc0589
          Member
          • Dec 2008
          • 32

          #5
          Ill put an example up. The calculation is quite simple currently seeing as I have not taken point density vs. efficiency in to account yet (by that I mean, If you need a tv with 1600x1020 resolution to get the job done, having 1900x1200 would be inefficient).
          I also may change it up so there is NO signal boost at any point, meaning lower target output would be used with padding everywhere (to avoid going above digital 0).

          Comment

          • jdc0589
            Member
            • Dec 2008
            • 32

            #6
            Originally posted by Hank
            This sounds interesting (and over my head, but I would be interested in the end result). Mark "The Kid" my have knowledge you are seeking. I'll ping him. I assume this could work for someone to determine the numbers for some think like, oh, say, an open baffle line array with digital filters? :W

            Here is the filter curve for some of my test data. The RAW frequency response is essentially the inverse of this graph, centered around the same target Db point (I think it was 62 Db here). Final F/R should theoretically look like the average between the filter graph and Raw response graph, which would be a flat line.

            I realize the X-axis tick marks are on drugs, but the scale is 20-20000hz.

            Click image for larger version

Name:	filterGraph.webp
Views:	23
Size:	14.7 KB
ID:	944527
            Last edited by theSven; 08 July 2023, 10:34 Saturday. Reason: Update image location

            Comment

            • ch83575
              Senior Member
              • Sep 2006
              • 128

              #7
              Have you seen this: http://www.acourate.com/ ?

              There are a few video tutorials on how to use the software that give great insight into the uses of the various functions...

              Very interesting stuff this. Keep up the good work.

              -Chad

              Comment

              • jdc0589
                Member
                • Dec 2008
                • 32

                #8
                Originally posted by ch83575
                Have you seen this: http://www.acourate.com/ ?

                There are a few video tutorials on how to use the software that give great insight into the uses of the various functions...

                Very interesting stuff this. Keep up the good work.

                -Chad
                I had written it off due to the $500 price tag. But, I may download the trial and see if the functions I need are enabled.

                Comment

                • ch83575
                  Senior Member
                  • Sep 2006
                  • 128

                  #9
                  Hey, don't get me wrong... I am all for DIY, even software. If you can come up with a utility to accomplish what needs to be accomplished to implement this without the $500 software that is great! Especially if it is something you might plan on sharing with the rest of us when you are done ;x( . I do think the acourate white paper is a good read and the video tutorials give you an idea of how the software works. I was just pointing it out so you might not have to re-invent the wheel in every aspect. There are also interesting conclusions I have seen related to the acourate software that will probably hold true with your own endeavors; for instance, I have read on the acourate website and in a build thread where the software was used that using the FIR for driver linearization outside of the passband can actually be harmful to the finished sound even though it makes it follow the target more closely.

                  All just food for thought. I for one am very interested in your project, so keep us posted.

                  -Chad

                  Comment

                  • ergo
                    Senior Member
                    • Mar 2005
                    • 676

                    #10
                    Take a look at


                    From slide 106 onwards this presentation has some interesting info on software equalizing the loudspeakers. (I did not figure out a way to link to that page straight... so one has to look from beginning onwards, but that is interesting as well anyhow)

                    My experience this far is similar, ie it is very worthwhile to measure at more than one point, average the responses and then try to compensate only the peaks or dips that show up in the average. How far off axis one should go from on axis is of course also a big question.

                    Ergo

                    Comment

                    • ch83575
                      Senior Member
                      • Sep 2006
                      • 128

                      #11
                      Originally posted by ergo
                      Take a look at


                      From slide 106 onwards this presentation has some interesting info on software equalizing the loudspeakers. (I did not figure out a way to link to that page straight... so one has to look from beginning onwards, but that is interesting as well anyhow)

                      My experience this far is similar, ie it is very worthwhile to measure at more than one point, average the responses and then try to compensate only the peaks or dips that show up in the average. How far off axis one should go from on axis is of course also a big question.

                      Ergo

                      What a great presentation. Good read all the way through. Talk about a totally different take on the use of FIR filters in loudspeakers. Dr. BrĆ¼ggemann (who wrote the acourate software) seems to think the subtractive filter generation technique is the holy grail of loudspeaker design, and Bruno Putzeys (the slideshow guy... apparently works for Hypex) says that the technique is... and I quote: "naive."

                      It does seem to me that canceling pre-ringing with more pre-ringing in non-coincident drivers would be dubious at best.

                      Of course this thread is supposed to be about driver linearization using convolution, which is also discussed at some length. Again, very cool read... thanks for the link!

                      jdc0589,
                      Are you using a passive crossover in the speaker? The convolution is at the source and for the entire system response?

                      -Chad

                      Comment

                      • TacoD
                        Super Senior Member
                        • Feb 2004
                        • 1080

                        #12
                        Originally posted by ch83575
                        What a great presentation. Good read all the way through. Talk about a totally different take on the use of FIR filters in loudspeakers. Dr. BrĆ¼ggemann (who wrote the acourate software) seems to think the subtractive filter generation technique is the holy grail of loudspeaker design, and Bruno Putzeys (the slideshow guy... apparently works for Hypex) says that the technique is... and I quote: "naive."

                        It does seem to me that canceling pre-ringing with more pre-ringing in non-coincident drivers would be dubious at best.

                        Of course this thread is supposed to be about driver linearization using convolution, which is also discussed at some length. Again, very cool read... thanks for the link!

                        jdc0589,
                        Are you using a passive crossover in the speaker? The convolution is at the source and for the entire system response?

                        -Chad
                        Bruno designed the ucd switching amplifiers, so I think he knows a thing or two about filters.

                        Comment

                        • jdc0589
                          Member
                          • Dec 2008
                          • 32

                          #13
                          Originally posted by ch83575

                          jdc0589,
                          Are you using a passive crossover in the speaker? The convolution is at the source and for the entire system response?

                          -Chad
                          Currently, there is nothing passive at all; Its a straight shot from the amp to the speakers. But, Ill go ahead and say its probably a better idea to do a little general filtering via passive components and do moderate/fine tuning via corrective software; especially if its a multi-way, I would lean towards more passive solutions around crossover points.

                          I e-mailed the guys at acourate and they said it would easily be able to take my text based f/r curves and turn them in to filter files. I may see if the demo will let me.

                          Comment

                          • Amphiprion
                            Senior Member
                            • Apr 2006
                            • 886

                            #14
                            Hi,

                            Like Hank said, I have some experience with this. My senior design project in college was a DSP based loudspeaker system. We measured each individual driver with Liberty Instruments LAUD, imported the resulting CSV files into Matlab, turned the CSV files into complex frequency responses for each driver. Then we divided an idealized frequency response for each driver by its actual complex frequency response. The result was a complex response that was perfect for correcting the drivers but was not describable with simple polynomial based filters. We approximated these idealized correction plots with a built-in function in Matlab (invfreqz) to turn them into IIR filters for each driver that would essentially be a perfect crossover to get each driver's raw response to match what we wanted that driver's final response to be.

                            This was six or seven years ago, and I can dig up the work if you want. It was fairly successful, but we only used ~10th order polynomials to approximate the 'ideal' transfer function for each driver. Matlab got unreliable in doing higher-order systems, probably something do to with precision problems with the built in algorithm.

                            Comment

                            • davey_m
                              Member
                              • Nov 2008
                              • 37

                              #15
                              You could try the open source package Octave too. Much commonality with Matlab and it has all the functionality you need.

                              With Octave it is easy to derive filter, driver correction, and combined driver correction and filter functions.

                              What makes it a little more involved are the following two issues:

                              - With driver correction functions you usually want to limit correction for sharp deep dips, as it might increase the required amplfier voltage swing too much.

                              - When using FIR filters you must also check for pre-ringing, which might be audible. A certain amount of pre-ringing is inaudible and therefore acceptible. Use accepted psychoacoustics principles for this.

                              Comment

                              • TacoD
                                Super Senior Member
                                • Feb 2004
                                • 1080

                                #16
                                Originally posted by Amphiprion
                                This was six or seven years ago, and I can dig up the work if you want. It was fairly successful, but we only used ~10th order polynomials to approximate the 'ideal' transfer function for each driver. Matlab got unreliable in doing higher-order systems, probably something do to with precision problems with the built in algorithm.
                                Newer versions of Matlab have some additional handy functions in the signal processing toolboxes. Especially the algorithms to fit a FIR filter to an arbitrary magnitude or phase target are useful. If you export the coefficients and use these on a linux machine with brufefir convolution running, you are in business.

                                In the first trials I used a transfer function of a passive filter design from LspCAD in order to try to mimick a passive filter, however this was somewhat harder than a plug and play ultra-steep filter.

                                One big drawback in this methodology is that you need a copy of Matlab with the signal processing toolbox (makes life more easy), this is rather expensive (~1500 + 1500 euro) if you are not a student anymore or not working for a company with a license.

                                Comment

                                Working...
                                Searching...Please wait.
                                An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

                                Please push the back button and reload the previous window.'
                                An unexpected error was returned: 'Your submission could not be processed because the token has expired.

                                Please push the back button and reload the previous window.'
                                An internal error has occurred and the module cannot be displayed.
                                There are no results that meet this criteria.
                                Search Result for "|||"