Post Reply 
Room correction with convolution per sample rate
01-12-2018, 21:36
Post: #17
RE: Room correction with convolution per sample rate
Simon - thanks for researching ffmpeg and figuring out what is going on.

Quote:In FFmpeg 4.1, the afir filter has some settings for applying different gain computations (see this section). The default is gtype=peak. If you specify gtype=gn instead, you should get something close to JRiver. The syntax for specifying this is:

convOut=-i /mnt/disk1/share/MinimServer/convolution/Cor1S44.wav -lavfi afir=gtype=gn

I switched back to ffmpeg 4.1 with your suggested stream.options:
convOut=-i /mnt/disk1/share/MinimServer/convolution/Cor1S44.wav -lavfi afir=gtype=gn

The output volume is now only attenuated by about 3.3 dB (83.2 dB with stream.options and stream.transcode <blank>, vs 79.9 dB with stream.options as above and stream.transcode "flac:wav;").

Quote:A simpler alternative to specifying a different convOut string for each sample rate would be to add support for substitution parameters in the convOut string, as follows:

#samplerate# would be replaced with the sample rate of the input file (44, 352, etc.)
#samplebits# would be replaced with the sample bit depth of the input file (16, 24, etc.)

Other values could be added later if required (for example, #outsamplerate# or #outsamplebits#).

With this support, you could use a stream.options setting of

convOut=-i /mnt/disk1/share/MinimServer/convolution/Cor1S#samplerate#.wav -lavfi afir=gtype=gn

I think this would work fine. It also has the advantage that you aren't forced to upsample and use a single higher sampling rate convolution filter (stream.transcode could be "flac:wav;" with your proposal).

As a comparison, JRiver, can handle arbitrary FIR file names - and resample a filter on the fly to match different sample rates (e.g., see Automatic Resampling). It's tricky, though, to do this right (e.g., this).

The "better" approach is to have separate convolution filters per sample rate, just as you propose. JRiver uses "standard" config files. See Config file, and Config examples. Having defined a configuration file for one sample rate e.g.., "Name2.0_441.cfg", JRiver will automatically search for " Name2.0_48.cfg" for 48 kHz sample rates (similarly for other sample rates).

Your suggestion is simpler - not worrying about config files (without the complexity/flexibility to define input/output channels, channel mapping, delays, ...).
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Room correction with convolution per sample rate - digimuse - 01-12-2018 21:36

Forum Jump:


User(s) browsing this thread: 1 Guest(s)