Welcome, Guest
Username: Password: Remember me

TOPIC: Resample impulse to give specific number of taps

Resample impulse to give specific number of taps 4 years 3 months ago #24982

  • sly
  • sly's Avatar
  • Offline
  • Gold Boarder
  • Posts: 214
  • Thank you received: 121
  • Karma: 30
Looking at rePhase, you can create a correction filter, specify the number of taps and export the correction. I've been playing around with inverting the impulse response of my system with Holm Impulse. Take the impulse response of a speaker, invert it and then use that as your correction filter. Theoretically this will correct the amplitude response and unwind the phasing, making it linear. This is all assuming that the system is minimum phase...

I tried feeding an inverted impulse response into JRiver for my home theater. JRiver can take almost anything to perform its convolution. So all I do is save the inverted impulse response as a .wav file and then load it into JRiver. It actually works and I have to say the results are astounding. I would like to do something similar to this with an OpenDRC using the miniSHARC processor. The problem is the miniDSP only takes .bin or .txt files for FIR filtering and it only allows for a limited number of taps.

I already have the correction filter I want to use via inverting the impulse response. Is there any way to use rePhase to resample the impulse response as is and export it as a .bin or .txt with the specified number of taps? It seems rePhase only exports changes you make to the response from within the program. If I import the inverted impulse response into rePhase and do nothing to it but just export it to a .bin, all it does is output a flat line because I've done nothing in the program to correct it.

Any ideas? Is there another program that can resample an impulse response giving me the number of taps I need? I know that reducing a .wav to 2048 taps is going to greatly reduce its resolution but this is the price to pay for the real time processing that the miniSHARC does. Is there something in rePhase that might be able to do this or some other method that I haven't thought about?
The administrator has disabled public write access.

Resample impulse to give specific number of taps 4 years 3 months ago #24986

  • pos
  • pos's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 350
  • Thank you received: 196
  • Karma: 39
Hello

"Brutal" impulse inversion is a very dangerous game (and I mean DANGEROUS, like in destroying your drivers).
Programs such as DRC-FIR go to great lengths to avoid problems and actually get a good results.
You should probably try Align2 which nicely wraps DRC-FIR and has a dedicated forum section here.

Rephase is only meant for manual corrections :)
https//wavetracing.com | rephase.org
Last Edit: 4 years 3 months ago by pos.
The administrator has disabled public write access.
The following user(s) said Thank You: sly

Resample impulse to give specific number of taps 4 years 3 months ago #24987

  • sly
  • sly's Avatar
  • Offline
  • Gold Boarder
  • Posts: 214
  • Thank you received: 121
  • Karma: 30
Thanks for that. I'll look into it. When I say I have inverted the impulse response, I did use smoothing to reduce the peaks and I limited the response with brick wall crossovers. It also helps to measure a speaker directly without the effects of the room to keep everything minimum phase. This way I don't boost a frequency to infinity by inverting a room cancellation. :)
The administrator has disabled public write access.

Resample impulse to give specific number of taps 4 years 3 months ago #24988

  • john.reekie
  • john.reekie's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 3772
  • Thank you received: 1584
  • Karma: 141
I don't think you're wanting to resample the impulse response, but truncate it (or preferably, window it).

?
I am not miniDSP support.

"You must ask the right questions." - Dr. Alfred Lanning's hologram.
-> Have you read the User Manual??
-> Have you drawn and posted a diagram?
-> Have you posted a screenshot?
-> Have you posted your config file?
The administrator has disabled public write access.

Resample impulse to give specific number of taps 4 years 3 months ago #24989

  • sly
  • sly's Avatar
  • Offline
  • Gold Boarder
  • Posts: 214
  • Thank you received: 121
  • Karma: 30
So far what seems to work is to invert the impulse measurement in Holm, adding smoothing and crossovers to protect the speakers. Import the inverted impulse response into REW. Then export the impulse response as a .txt file. Copy and paste the biquads in the .txt file to the FIR section of the openDRC, leaving out the leading and trailing zeros. It's kind of a manual way to window the measurement. The raw impulse file had over 200,000 taps. But deleting the zeros reduced it down to only ~300. This is for the tweeters. The lower frequency speakers need exponentially more taps. I still don't have enough taps to do the subwoofer.

There may be another way of doing it, but doing it this way I generate only the exact number of taps needed for the filter. No guesswork. I found that my tweeters had 648 taps allocated but I only needed about 300. I reduced the allocated taps to 300 and that freed up more taps for other channels. Now that I'm changing the number of taps to each channel, I'll have to time align the system all over again.

But it's nice to see a way of inverting an impulse response and using it in the openDRC. It's opened up a whole new way of EQing. I see hours of tuning in my immediate future.
Last Edit: 4 years 3 months ago by sly.
The administrator has disabled public write access.

Resample impulse to give specific number of taps 4 years 3 months ago #24991

  • pos
  • pos's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 350
  • Thank you received: 196
  • Karma: 39
Impulse inversion is indeed a seducing concept. Going from that concept to something that does no break you speakers is a good start, but then going from that to something that actually sounds good (ie correct what needs to be corrected, the way it needs to be corrected, and let measurement artifacts and position dependent things alone) is another thing altogether.
This is what DRC-FIR does, and it is not simple, nor is it perfect.
That is why I committed to manual corrections only in rephase.

By smoothing the response as you do you are already giving up on some resonances that would need to be corrected with the correct (precise) Q to address both their frequency and temporal aspects.
https//wavetracing.com | rephase.org
Last Edit: 4 years 3 months ago by pos.
The administrator has disabled public write access.
The following user(s) said Thank You: sly

Resample impulse to give specific number of taps 4 years 3 months ago #24996

  • sly
  • sly's Avatar
  • Offline
  • Gold Boarder
  • Posts: 214
  • Thank you received: 121
  • Karma: 30
This is definitely looking to be more complicated than I initially assumed. From what I gather, the idea is to find the actual minimum phase response of the system and correctable room modes. Considering the measurement is a blend of speaker and room artifacts, it's very difficult to segregate the two. An inverted impulse response can only correct artifacts of the speaker and to reduce over excitement of room modes. It would seem that if you could measure the speaker inside an anechoic chamber to determine what is actually minimum phase then you could correct at least that part of it with an inverted impulse. But then once you place it in a room you have a whole new set of variables to deal with. Some are correctable and some are not. Lots of reading to do...
Last Edit: 4 years 3 months ago by sly.
The administrator has disabled public write access.

Resample impulse to give specific number of taps 4 years 3 months ago #25077

  • Richard
  • Richard's Avatar
  • Offline
  • Expert Boarder
  • Posts: 132
  • Thank you received: 71
  • Karma: 13
Hi Sly,
Going back to your original question, yes, I think it's possible to import the inverted impulse response into OpenDRC, certainly if you already have it as a WAV file, there is software that can read the wav and generate a 6144 tap 48kHz sample rate 32bit bin file to import into OpenDRC. For example, Cool Edit Pro can do this, in simple terms of opening the wav, checking the correct settings and saving file as raw PCM data which you can rename as a bin file. It works.

If you've already got it exported as txt file from HOLM then you can import into rePhase and spend 45 minutes dialing in all the bumps and dips manually and save the result...

Pos is correct to point out that one mic measurement, simply inverted in amplitude and phase and re-applied to your speaker could create dangerous narrow peaks, if you have a narrow notch or null cancellation in the measured response. These type of instant invert automatic corrections don't really work, unless you happen to own an anechoic chamber. If you're measuring within a living room in a domestic house with acoustically reflective ceiling and walls and windows, etc. you WILL get a coloured / corrupted version of the truth from any given single mic measurement.

Really you need to take dozens if not hundreds of mic measurements, then get HOLM to export them as text files, and average all these results mathematically for average amplitude and average phase values at each FFT frequency using a spreadsheet program like Microsoft Excel or Claris Filemaker Pro that can handle the 32K+ data values of each txt file. The formula to average them is based on the cosine theorem, taking vectors for amplitudes and phase angles for each discrete frequency. Once you've calculated the average response of the speaker you'll have a much better chance of generating a worthwhile correction. Really this should be done for tweeter, midrange and woofer drivers individually, per side individually, and then you can get the drivers correct and use linear phase crossovers to their best effect too.
Last Edit: 4 years 3 months ago by Richard.
The administrator has disabled public write access.
The following user(s) said Thank You: sly

Resample impulse to give specific number of taps 4 years 3 months ago #25081

  • sly
  • sly's Avatar
  • Offline
  • Gold Boarder
  • Posts: 214
  • Thank you received: 121
  • Karma: 30
Richard wrote:
These type of instant invert automatic corrections don't really work, unless you happen to own an anechoic chamber.
I think this is the conclusion I'm coming to. I played around with inverting the impulse on the tweeters in my car and it sounded horrible. I can't really dampen the car enough to get an accurate response, short of removing the tweeter and measuring it in a remote location.The home theater sounded pretty good but the car measurement was picking up early reflections off the windshield. I guessed that it wouldn't work and was right.

I'm actually in the process of constructing an anechoic chamber. I have a 475ft^2 detached utility building that could house a small chamber for measuring high and some mid frequency sounds. It won't be large enough to absorb low frequencies but should work for the higher frequencies to give me a better picture of what the speakers are doing.

I'm primarily wanting to invert the impulse to give better detail and imaging in the soundstage. If I can get a true response out of the speakers then I can fine tune the sound with linear phase EQ like you mentioned. I wish more speaker manufacturers gave out their anechoic response graphs. That would be extremely useful in tuning a system.

Thanks for the response. It gave me something to think about. I'll look into Cool Edit. That's a program I've not played around with yet.
The administrator has disabled public write access.

Resample impulse to give specific number of taps 4 years 3 months ago #25092

  • Richard
  • Richard's Avatar
  • Offline
  • Expert Boarder
  • Posts: 132
  • Thank you received: 71
  • Karma: 13
Hi Sly,
If you've got enough resources to build your own personal anechoic chamber at home, you're one lucky chap!
My room has got Illsonic Sonex Acoustic foam over the ceiling and some of the walls so it's pretty dead, but it's far from perfectly anechoic.
I've been inside the chamber at I.S.V.R. in Southampton University, England and it was amazing. Back then, in about 1999, it cost approx. £800 to hire out that chamber for half a day. I've no idea what it costs now. How regularly do you need to do speaker measurements ? Really only once seriously to achieve the initial calibration and verification. You could maybe recheck once a year in case drivers had drifted in performance, but of course if you owned the chamber at home it could be your perfect listening room 365 days a year anyway. You could also have a FFT screen permanently setup to show the transfer function while listening to music with direct line source vs mic input as the cross transfer function - like the Meyer SIM system, but ideally it would just be a straight line anyway, and hardly change, even if you moved the speakers around a bit - that's the beauty of anechoic chamber.
I own an Earthworks M50 mic and measure at home, but have often wondered if it might be worth taking all my gear for a day out to a professional anechoic chamber to get one really decent set of measurements done, for the cost of one day's hire. It would surely be better than I could ever do at home.

Cool Edit and Cool Edit Pro are two different versions, to avoid confusion, I can only vouch for the Pro version. It later became Adobe Audition after they bought Syntrillium Software.
I don't know if you can upload a short impulse wav file or post a download link here into this forum, but if you just needed one little wav impulse file converted into a 6144 tap bin file, I could probably do that for you, easier than buying and learning a whole new software package.

Talking generally, it makes me laugh when you see these commercial products marketed with the "it's so easy" premise - just buy this basically cheap Behringer ECM8000 omni mic and put it on a stand somewhere close to your head on the sofa at your listening position, connect some wires to your computer soundcard and run a 20Hz to 20KHz sweep that lasts about 5 seconds, press the magic button and the software will calculate the perfect correction for your speakers. It's total crap. That can't possibly work in one go like that, yet you see Behringer UltraCurve with built-in Auto EQ option , JBL selling nearfield monitors with a mic auto calibration system, and lots of even expensive high-end products like DEQX and HOLM and others basically luring you into thinking it's a quick and easy job to do a calibration with just one measurement per speaker in a domestic environment. Even with time windowing, they just aren't getting a valid representation of what the driver is really putting out. Whenever you sweep from 20Hz to 20kHz you're going from a wavelength of 17.2 metres (56.5 feet) length to a wavelength of 1.72 centimetres (0.678 inches) length and every distance (every frequency) inbetween, so unless your room is an aircraft hanger size, the wavelengths WILL at various frequencies over the sweep range match the various room dimensions and give you resonant standing waves, with their nodes and antinodes, causing exaggerated peaks and dips due to interference between the direct speaker wave and the room reflected wave. And this happens in many different axis as a complicated 3D geometric phenomenon. It's a nightmare trying to get an honest measurement of the loudspeaker alone in the messy jungle of room acoustics interaction. You need to repeatedly measure speaker and mic from lots of different locations and average them out to distill the speaker behaviour from the coloration of the room. And really, to thoroughly validate to correction afterwards, you would have to go through a similar process. Unless of course you have an anechoic chamber and can remove room acoustics from the equation.
Last Edit: 4 years 3 months ago by Richard.
The administrator has disabled public write access.

Resample impulse to give specific number of taps 4 years 3 months ago #25099

  • sly
  • sly's Avatar
  • Offline
  • Gold Boarder
  • Posts: 214
  • Thank you received: 121
  • Karma: 30
What I'm thinking is that if I can build a small anechoic chamber, I might be able to do some acoustics measurements in the future for some custom built speakers and enclosures that I might want to bring to market. Audio has been an obsession of mine since I was 13 when I correctly rewired an aftermarket stereo in my dad's truck that was improperly installed. So for the past 24 years, it's definitely been a constant in my life. I can see myself doing professional installs, etc.

I was thinking about measuring the low frequency response of the drivers... as you said, a 20Hz wave is over 50 feet long. I don't own an aircraft hanger but I do have a large, flat back yard out in the country. What if I measured the highs and mids, down to a determined frequency, inside the chamber and then finished up the measurement for the lows outside? Then I could stitch the two measurements together...

Outside has lots of ambient sounds but at night it's pretty quiet. I could measure the speaker down to the chamber's lowest absorptive frequency which could be determined by the size of the absorption baffles,. Then I could remeasure the speaker outside, 6 feet off the ground pointed toward a flat area that extends for over a mile. Do you think an outdoor measurement would approximate an anechoic chamber for the lower frequencies? I think I can stitch the two measurements together in Sound Forge but I've never tried so that will be another learning curve.
The administrator has disabled public write access.

Resample impulse to give specific number of taps 4 years 3 months ago #25102

  • jimbee
  • jimbee's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 1
  • Karma: 0
sly wrote:
Take the impulse response of a speaker, invert it and then use that as your correction filter. Theoretically this will correct the amplitude response and unwind the phasing, making it linear.


Hi Sly,
I probably missed something but, as far as i know, this way corrects the phase but not the amplitude,
non-linéarities of amplitude are squared:
Let's say the initial response of the speaker is Butt2 high pass, Butt2 low pass and +/- 3dB in the band.
Using its reverse impulse in a convolver will give a linear phase LR4 high pass, LR4 low pass, but +/- 6dB inside the band.

cdt
The administrator has disabled public write access.

Resample impulse to give specific number of taps 4 years 3 months ago #25111

  • Richard
  • Richard's Avatar
  • Offline
  • Expert Boarder
  • Posts: 132
  • Thank you received: 71
  • Karma: 13
Jimbee,
He's not talking about running the impulse in reverse, which would behave as you say, he's talking about the total inversion of the transfer function, another word for the reciprocal of it. ie. The positive amplitude boosts become negative cuts and vice versa, and the positive phase shifts become negative phase shifts and vice versa. It un-does all the action of the original impulse. HOLM can generate a reciprocal function A=1/B under its Manipulations menu. It is unfortunate they've used the term "inversion" rather than "reciprocal" because to most people "invert the signal" usually means a polarity inversion (which other people erroneously might call a 180 degree phase invert, because all frequencies are 180 degrees opposite, even though there is no relative phase shift.)

Sly,
By all means try all the options you can. Outdoor measurements need to be quite loud to overcome wind noise, and repeated and averaged, far more so than indoor measurements. Beware birds tweeting, dogs barking, cars driving past, wind noise, and other uncontrolled noises bleeding into your test, hence the repeated averaging is needed. Rain is also best avoided obviously!

I've often thought a large tent or marquee outdoors on grass would make a really good loudspeaker test area, it's nearly anechoic, and blocks out some of the wind and waterproof if it does suddenly pour with rain. When I've done gigs outdoors in marquee like a wedding reception, the sound is always really tight and clear without the room wall and ceiling reflections. I don't own a marquee or tent though. It would probably need to be large enough to stand up and walk about in if you were gonna work out there for hours, but it's the sort of thing you could do in your back garden in the warmer weather, but you'd still be at the mercy of outdoor noises, and in the summer more people are outdoors with their windows open. At least inside a tent people (nosy neighbours) can't directly see you or your equipment and might wonder where that funny pink noise sound is coming from. Though if you play three hundred consecutive sine sweeps for 6 hours straight at 110dBSPL you'll probably annoy the neighbours and any dogs in the local area. Don't they start barking above 20kHz???!

Anechoic chamber, indoors or outdoors - there are many, many established techniques and ways to go about all this, and all are equally valid and scientific. Loudspeaker Measurement is a gigantic topic in its own right and there isn't just one right solution. You can certainly measure low frequencies indoors in the room, but you'll need to do close mic omni measurements right up close to the woofer cone which will always be an antinode and gives good results, although don't forget to measure the port output contribution and factor that in too. Only if you place the mic a few metres away in the room, then standing waves from room reflections will colour the results and then you'll have to move to multiple positions (both mic and speaker) taking numerous measurements to average out the room mode effects.

Ideally the more woofer measurements you can make with different techniques and setups, the more completely you'll know the behaviour of your woofer and spot the common measurement trends which are revealing woofer's true response vs the weird peaks and dips which plague certain mic locations in the room and would otherwise muddy the picture and obscure the truth.

I guess you have to try several methods and whichever one yields the best data with the most convenient, repeatable setup is the one you'll use most often...

It occurs to me that one of those large semi-circle mic isolation vocal booth screen shields might be useful, if you don't have a full anechoic chamber, to help block room reflections coming back into the omni measurement mic. I don't own one of those so I haven't tested any, and I doubt they're very effective at low frequencies which means they might allow low freq reflections back into the mic while attenuating mid and high freqs, resulting in a skewed coloured overall picture at the omni mic. Still, they're quite cheap to buy and experiment with, but so is your bed duvet or blankets etc. Has anyone out there used a mic screen during loudspeaker measurements? Any recommendations? Might help outdoors too with wind noise. I'd suggest putting the screen on a 2nd separate mic stand rather than the same stand the critical mic is attached to. I found a comparison review of these online here.
Last Edit: 4 years 3 months ago by Richard.
The administrator has disabled public write access.
The following user(s) said Thank You: sly
Moderators: devteam