Processor: Not Relevant
Licensed under a Creative Commons Attribution 3.0 Unported License
There are may times in DSP algorithm design where you need to run your new and shiny algorithm against a bunch of test vectors. In audio processing, it is usually WAV files. The only problem is that if you are constantly adding/removing files from your test database, you have to keep changing the filenames and path in your m-file.
But using the code below, it is now possible to point your m-file to a directory and say "go". Files can be added/removed/renamed and each time you run this code it will scan the files that match the WAV extension and it will dump the outputs in a separate folder. In essence, you have a way to batch process any number of files in a specific directory.
The code below shows a simple lowpass filter is applied to the entire directory of WAV files in the folder: "test_input_database". This script can be tweaked to use any file type you want as long as you have the appropriate I/O parser.
Note: This code is not recursive. All files must exist in one input folder.