How can I apply a 24db/oct LR high and low pass filter to a WAV file?

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hi,

Is there any software for the PC or OSX that will allow me to apply a 24dB/octave LR or butterworth filter to a WAV file?

Free software would be preferable, I've tried audacity and along with a few plugins, but so far have found no software that will do this!

Thanks
 
I'm guessing the filter functions in Audacity and other DAW programs are only approximations of what the OP wants to do, to precisely simulate a filter based on the values of its electrical components. I'm sure there are speaker crossover simulator programs that work through a soundcard or operate on a .wav file

Here's something that looks close, but it doesn't read/write a .wav file:

Digital Filters with GNU Octave


I'd think there would be Octave functions to handle .wav files, I've seen that Matlab has such functions.

It shouldn't be too much code to simulate L's, R's and C's in Octave or Matlab, so much so that I'd think it's been done before, even with .wav file I/O.
 
sim the crossover in spice

LTspice circuit simulator has .wav read/write functions - just draw your crossover circuit, include a source with a .wav file independent source input, add the .wave directive to write out specified nodes

definitely use much smaller tmax step size than the sample interval in the .tran statement

won't do real time

next problem is to playback the channels in sync - the .wav format allows multichannel in one .wav so you could process a stereo souce to a 4 or 6 channel .wav output


my experience with SciLab showed it to be very inefficient with 24 bit extended wave read/write functions - it uses less of SciLab's stacksapce and it is faster to use "32 bit" files if you need hi res - stacksize limits you to a few minuites of audio file processing


the horsepower for realtime streaming with a dozen or so IIR biquads should be available in media player DSP plugins on most PCs - with crossover frequencies <~1/10 of fs IIR digital filters will be very close aproximations to the analog filter response
 
Last edited:
This is an example of sox in linux, the parameters are the same in windows:

Generating 10 secs of white noise, 24bit, 48kHz, mono:

Code:
sox -n -c 1 -b 24 -r 48000 white.wav synth -n 10 white

Just checking its spectrum, it does look like white noise:
Code:
sox white.wav -n spectrogram -o spectrogram.png

display spectrogram.png

spectrogram.png


Let's see response of the 12dB/oct (2 poles, 6dB/oct each?) "highpass" filter of sox at 10kHz:

Code:
sox --plot octave -n -n highpass 10k  > highpass.plt

octave highpass.plt

highpass.png


What does it do to the spectrum?

Code:
sox white.wav -n highpass 10k spectrogram -o spectrogram-hp12.png

display spectrogram-hp12.png

spectrogram-hp12.png


24 dB/oct - let's stack two filters on top of each other:

Code:
sox white.wav white-hp24.wav  highpass 10k highpass 10k spectrogram -o spectrogram-hp24.png

display spectrogram-hp24.png

spectrogram-hp24.png


This time I specified in sox the name of the output wav file instead of the "no-file" parameter -n and the file white-hp24.wav with the spectrum above was stored for further use.
 
Last edited:
PC crossover

Hi,

Is there any software for the PC or OSX that will allow me to apply a 24dB/octave LR or butterworth filter to a WAV file?

Free software would be preferable, I've tried audacity and along with a few plugins, but so far have found no software that will do this!

Thanks

Do you want to make a pc crossover?
.
http://www.diyaudio.com/forums/multi-way/63078-how-pc-xo.html
.
http://www.diyaudio.com/forums/multi-way/161768-violet-dsp-evolution-open-baffle-project.html
.
http://www.diyaudio.com/forums/multi-way/142015-my-open-baffle-dipole-beyma-tpl-150-a.html
.
Transient Perfect loudspeaker DSP tools . Windows DSP speaker crossovers.
.
(((acourate)))® - Room Correction, Speaker Optimization and Sound Improvement
 
Whoah, there. All the OP wanted was this:

Is there any software for the PC or OSX that will allow me to apply a 24dB/octave LR or butterworth filter to a WAV file?

I know he said Audacity doesn't seem to do what he wants, but maybe that's because of its filter controls. Audacity has 3 controls for its LP and HP filter effects: Corner frequency, cutoff slope, and Q. The key is that any simple filter can be specified in terms of those 3 values. For example, a 4th order L-R filter has a slope of 24 dB/octave and a Q of 0.49.
 
Hi, thanks all, I think I should have provided a little more detail in my first post. :) Right now I'm testing some 2 way speakers which have no crossover and I'm using a 2 channel amp to power the speaker, the L channel powering the woofer and the R channel powering the tweeter, and I was planning to convert some of my music so I could simply test out the speaker with sending any low frequencies to my tweeter.

The plan was to compress the filtered music to FLAC, and then use my portable music player to test out the speaker. I was trying to use Audacity, but could not find any LP or HP with a Db/oct setting, only a Q setting which I'm not familiar with.

I'm quite familiar with the excellent foobar2000, so I tried using the xover plugin for foobar2000, and then made it save the output to a WAV file, and after using foobar2000 again to compress to FLAC, everything is now sounding great and I now know that everything is working as it should.

I plan to eventually use a modified DCX2496 for crossover duties.
 
I could simply test out the speaker with sending any low frequencies to my tweeter.

Hi Mike, I assume that suppose to say without.

If you set the tweeters to a secondary chanel (not the front) then they can not be destroyed by other applications or Linux sounds, as these only go to the main jacks (front left and right).

If you use a Soundcard like the Bluegears B-enspirer there is no need to spend money for a Behringer DCX.
It has the better AKM dacs already on it and with a few basic mods will sound fantastic.
I did this a while back and it sounded better than my extensively modded CD players.

Greets,
Klaus
 
Last edited:
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.