Windows PC as a FIR Audio Processor: how to?
The bill of specifications is the following:
- I want to listen to my PC-based music on my Hi-Fi system with the best possible audio quality (of course).
- No matter the media player or web music channel, every sound should be played.
- The PC should do all filtering, equalization and phase linearization, avoiding an external DSP.
- Digital audio will be outputed to a USB port (or sound card), analog converted and amplified.
Hardware
Any modern PC will work starting with Windows NT6 (Vista, 7 or higher).
Any USB audio Digital to Analog interface of good quality is suitable (or sound card, be it integrated, internal or external).
For my active multiway loudspeaker system, I chose an 8-channel
miniDSP
U-DAC8.
Two software solutions are presented below, a simple and elegant APO setup and a more complex ASIO setup. Both use impulse response files and a convolution engine.
APO software
Equalizer APO by Jonas Thedering is implemented as an Audio Processing Object
for the system effect infrastructure introduced with Windows Vista.
Download Equalizer APO and install it.
In Configurator, select the audio device to install the APO to.
In Sound Control Pannel device Properties, don't disable all Enhancements (although Equalizer APO is not shown).
Impulse response and configuration file
rePhase by Thomas Drugeon is a loudspeaker phase linearization, EQ and filtering tool.
Download rePhase
and install it in the E-APO config directory,
%ProgramFiles%\EqualizerAPO\config by default.
In Impulse Settings, set the sample rate to match the sample rate of the audio device.
For a sample rate of 96000 Hz, 16384 taps, precision is 2.93 Hz (SampleRate/Taps/2) up to 48000 Hz (SampleRate/2).
With middle centering, the impulse offset is 8192 samples (Taps/2) which gives a delay of 0.085 seconds (Taps/SampleRate/2).
Save the rePhase .wav generated impulse response files in the E-APO config directory.
Edit the E-APO configuration file
config.txt
to suit your needs.
Here is an example for a 4-way stereo loudspeaker system:
# Channels (7.1)
# 1 2 3 4 5 6 7 8
# L R C LFE RL RR SL SR
Stage: pre-mix
Copy: 1=L+0.5*C 2=R+0.5*C 3=L+0.5*C 4=R+0.5*C 5=L+0.5*C 6=R+0.5*C 7=L+0.5*LFE 8=R+0.5*LFE
Channel: 7 8
Preamp: -6 dB
#Convolution
Stage: post-mix
Channel: 1 2
Convolution: IR_sub.wav
Channel: 3 4
Convolution: IR_low.wav
Channel: 5 6
Convolution: IR_mid.wav
Channel: 7 8
Convolution: IR_high.wav
That's all. If you need or prefer Audio Stream Input/Output, a solution is presented below. Otherwise you're done.
ASIO software
Several pieces of software are needed to do the job. Here is a slightly simplified workflow:
- WDM Audio --> Hi-Fi Cable & ASIO Bridge --> ASIO4ALL --> VSTHost & ConvolverVST
Start by creating a root directory, e.g. C:\PrgFiles, and give other users read access.
Hi-Fi Cable & ASIO4ALL
ASIO4ALL by Michael Tippach is a universal ASIO Driver for WDM Audio.
Download ASIO4ALL and install it.
With Hi-Fi Cable & ASIO Bridge application by Vincent Burel, in regular Pass Through mode all incoming audio on input is going to audio output of the Hi-Fi Cable. Download VB-Audio Hi-Fi Cable and install it.
In Sound Control Pannel, set Hi-Fi Cable Input and Output as the default Playback and Recording devices, respectively.
Set Advanced Properties of both devices to the same samplerate: 24-bit 96 kHz.
Configure Hi-Fi Cable's Input with multichannel if you require it. We'll stick to stereo for now.
VSTHost & ConvolverVST
ConvolverVST by John Pawel is a convolution plug-in for room correction, bass management, cross-overs, equalization etc.
Download ConvolverVST
and install it in a directory of your choice, e.g. C:\PrgFiles\Convolver.
Create a subdirectory, e.g. C:\PrgFiles\Convolver\Data, for the configuration file and impulse responses
that you will generate (see below).
VSTHost by Hermann Seib will be the host application for the convolution plug-in.
Download VSTHost
and install it in a directory of your choice, e.g. C:\PrgFiles\VSTHost.
Run vsthost.exe and create a shortcut in your own Startup directory:
%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup
or the all users Startup directory:
%ProgramData%\Microsoft\Windows\Start Menu\Programs\Startup.
In File New PlugIn... open C:\PrgFiles\Convolver\convolverVST.dll.
It will be connected between Engine Input and Output.
Open the Master Window to access the volume controls.
In Devices Wave... select ASIO4ALL Output Port and Sample Rate at 96 kHz.
In Devices Asio Control Pannel... Advanced Options, activate your WDM devices. Choose VB-Audio Hi-Fi Cable Input and USB Audio (or sound card) Output.
In Devices Asio Channel Selection... select the Stereo Pairs. Select VB-Audio Hi-Fi Cable inputs and USB Audio (or sound card) outputs.
In Engine Configure... assign the Input and Output Channels. Assign VB-Audio Hi-Fi Cable inputs and USB Audio (or sound card) outputs.
Download this flat 32-bit 96 kHz impulse response file
IR_stereo.wav
to your convolver data directory, e.g. C:\PrgFiles\Convolver\Data.
Edit ConvolverVST plug-in and open IR_stereo.wav in Filter/config.
You are ready to test your installation by playing something - but be sure to check the volume first!
Tuning
If you survived all of this then it's time to attack the improvement of your loudspeaker system.
Impulse response and Config file
rePhase by Thomas Drugeon is a loudspeaker phase linearization, EQ and filtering tool.
Download rePhase
and install it in a directory of your choice, e.g. C:\PrgFiles.
Save the rePhase generated impulse response files in the Convolver data directory, e.g. C:\PrgFiles\Convolver\Data.
For the simplest applications a single
sound file
can be used as a filter. That's what we did earlier for testing.
A Config file
allows you to specify more complex filters.
Save your config file in the Convolver data directory, e.g. C:\PrgFiles\Convolver\Data.
In VSTHost, edit ConvolverVST plug-in and open the Config file in Filter/config.
Here is an example for a multiway stereo loudspeaker system:
ConvolverVST Config file | Detail |
---|---|
96000 2 8 0
0 0 0 0 0 0 0 0 0 0 |
filter sample rate=96000, 2 input channels, 8 output channels, no mask
input channels, no delay output channels, no delay |
C:\PrgFiles\Convolver\Data\IR_Sub.wav
0 0.0 0.0 |
filter file name, subwoofer left
filter channel 0 input channel 0, no scaling output channel 0, no scaling |
C:\PrgFiles\Convolver\Data\IR_Sub.wav
0 1.0 1.0 |
filter file name, subwoofer right
filter channel 0 input channel 1 output channel 1 |
C:\PrgFiles\Convolver\Data\IR_Low.wav
0 0.0 2.0 |
filter file name, woofer left
filter channel 0 input channel 0 output channel 2 |
C:\PrgFiles\Convolver\Data\IR_Low.wav
0 1.0 3.0 |
filter file name, woofer right
filter channel 0 input channel 1 output channel 3 |
C:\PrgFiles\Convolver\Data\IR_Mid.wav
0 0.0 4.0 |
filter file name, midrange left
filter channel 0 input channel 0 output channel 4 |
C:\PrgFiles\Convolver\Data\IR_Mid.wav
0 1.0 5.0 |
filter file name, midrange right
filter channel 0 input channel 1 output channel 5 |
C:\PrgFiles\Convolver\Data\IR_High.wav
0 0.0 6.5 |
filter file name, tweeter left
filter channel 0 input channel 0 output channel 6, scale 50% = 20*LOG(0.5) = -6 dB |
C:\PrgFiles\Convolver\Data\IR_High.wav
0 1.0 7.5 |
filter file name, tweeter right
filter channel 0 input channel 1 output channel 7, scale 50% = -6 dB |
Voyez aussi trois solutions décrites par
jimbee
avec plein de références autour du sujet :
Multi amplification sur pc: filtrage / égalisation fir par convolution
Lastly
You can find an application for a multiway stereo loudspeaker system here: The Magical Number Seven, Plus Two.
Many thanks to the great people who made their software available freely. If you like any of the software, some authors accept donations.
June 2016