Project Description
Cross Time DSP implements conventional forward time IIR processing of music files as well as time reversed IIR. This allows linear phase via inverse allpass or other inverse filters in addition to standard equalization. Unlike other time reversed IIR implementations, it's free and doesn't require a PC in the audio playback chain.

Feature Summary
Cross Time DSP targets a rip -> filter -> burn workflow for manipulating music files, with Cross Time DSP performing some or all of the filtering operations. This is similar to performing mixing or mastering operations in a DAW or VST host and essentially the same as including DSP in the rip and burn pipeline of a media player.  What differentiates Cross Time DSP from the other numerous implementations in this space is its support for stream based time reversed IIR filtering.  As the name implies, time reversed filtering is a method where samples are passed through a filter backwards.  Other time reversed implementations are VST based and, therefore, are necessarily constrained to block based DSP.  Each block is reversed, filtered, and then returned back to the VST host in its normal order.  The purpose of doing this is the phase shifts induced by reverse time filtering are opposite those of forward time filtering so, by properly pairing reverse and forward time filters, the phase changes can be made to cancel.  This approach produces a linear phase response without the synthesis complexity or computational cost of FIR filters but the range of adjustment is limited by the size of the block.  Given sufficiently low frequencies, time reversed IIR implementations based on block DSP break down and emit discontinuities at the edges between blocks.  This can be mitigated in a variety of ways, such as increasing the block length, windowing together multiple overlapping blocks, or downsampling.  But practical implementations typically exhibit THD increases starting at a couple hundred Hz and struggle to be effective near audio's nominal low frequency limit of 20Hz.  So it's advantageous to change from a quasi-realtime block DSP approach in favor of an offline, stream based approach.

Cross Time DSP suits this purpose.  Inserting time reverse processing between ripping and burning means the entire audio track can be reversed and processed from finish to start all in one go.  As there's no need to stitch blocks together and there's freedom to increase the track length by a few hundred milliseconds, phase adjustments become effectively unlimited.  The downside is the resulting track is now specific to a particular playback configuration and the rip and burn cycle has to be repeated if something changes.  Fortunately, processing power and digital storage are cheap and changes in the playback setup uncommon.  So reprocessing a music library and copying the updated files to a flash drive or SD card isn't really a big deal.  Instead, the main challenge Cross Time DSP is knowing what equalization needs to be applied.  For example, if you want to preprocess tracks so they play back as linear phase on your speakers you need to know details of the speakers' crossovers and low bass response.  This likely means you built the speakers yourself or have the necessary test and measurement equipment to determine how the speakers are implemented.  Given this data the XML in Cross Time DSP's app.config file can be edited to specify the appropriate filters.

Development Status
Cross Time DSP is currently in late stage alpha with beta planned late 2012 and a 1.0 release in 2013.  Major releases beyond 1.0 are not expected at this time.

implemented features

  • forward and reverse time processing
  • full Bristow-Johnson biquad implementation
  • allpass first order filters
  • gain control for avoiding clipping from reversed time crest factor
  • read and write 16 and 24 bit .wav files
  • write FLAC files via flac.exe
  • read FLAC files via flac.exe and metaflac.exe
  • read MP3 files via lame.exe (metadata not supported as LAME doesn't offer a way to expose it)
  • sync between input and output music libraries
  • 64 bit floating point processing by default with a 32 bit fixed point option (64 bit accumulator)

features which might get implemented if demand materializes

  • pass and shelf first order filters
  • simpler specification of inverse allpass filters for correcting crossovers
  • ReplayGain calculation for FLAC files (just passing --replay-gain to flac.exe)
  • cuesheet support (given sufficent user need)
  • multithreaded batch processing (workaround is to run multiple Cross Time DSP processes concurrently on different directories)

features which have been considered but most likely won't be implemented

  • A GUI.  This is a nice to have and a project contributor's welcome to step in and implement one.  In the meantime, invoking Cross Time DSP's core functionality of syncing a library of processed music with a source library of unprocessed music is quite simple.
  • A standard filter design UI.  There are numerous tools already available which do this, many of them free, and it's easy to copy/paste their output into Cross Time DSP's config file.  That said, if a GUI gets added to Cross Time DSP a filter designer is a logical follow on feature.
  • Integration into popular media players.
    • Integration into Foobar 2000 as a DSP component.  Foobar's on_chunk() API is specific to block based foward time processing and isn't suitable for implementing reverse time processing.  It would be a major code change to modify this.  Sorry.
    • Integration into Winamp.  Same API limitation as Foobar.
    • Integration into Windows Media Player.  There's no technical obstacle here; Microsoft's plugin API is file based and hence can support stream based reverse time processing without much fuss.  However, there's currently no contributor to the Cross Time DSP project who's motivated to write the code.  Feel free to step in and change that.
  • Full support for encodings other than WAVE (PCM) and FLAC.  WAVE and FLAC are the de facto standards for lossless encodings.  While Fraunhofer found 256kbs MP3 to be CD audio equivalent and rates around 180kps are often considered CD equivalent in practice the subjectively audible loss threshold varies with the listener, quality of the listening environment, and fidelity of the playback system.  A statistically significant fraction of such combinations exhibits reliable discrimination between 320+kbps MP3 and FLAC with FLAC being preferred.  If you're pursuing linear phase it's likely you fall into this category and primarily use FLAC.  If this isn't you, there's a wide array of tools which can transcode output files from Cross Time DSP to MP3, Ogg Vorbis, WavPack, Windows Media, or whatever else might be your choice.  Contributors are welcome to implement support for other formats in Cross Time DSP.
  • Automatic synthesis of phase correction filters.  Without access to an anechoic chamber accurately measuring acoustic phase responses is difficult.  Most automatic inverse synthesis therefore suffers from garbage in, garbage out difficulties.  Some tools therefore explicitly choose to rely on hand selection of filters.  Cross Time DSP falls into this category.
  • Upsampling or downsampling.  Currently there's no compelling scenario for Cross Time DSP to support this as several software packages, some of them also free, already implement conversions between sampling rates.  There's also plenty of cost effective hardware which performs sample rate conversions at playback time.

Last edited Oct 15, 2012 at 4:06 AM by twest820, version 10