Sorting Filter Part 2
This is a kind of follow up to the previous thing about sorting filters. As well as doing the effect to images (which I did only because I had an easily accessible image library) you can apply it to sounds (which I have now done, since I have an easily accessible sound library). Actually, it makes a bit more sense when you apply it to a sound, and it is easier to see what is going on.
For those who didn't understand what I was doing, it will hopefully make more sense here: you take the waveform of a sound (which is just a collection of numbers) and put the numbers into groups of a fixed size (say groups of 10). In each of these groups, you sort the numbers. This will give you a wave that (typically) has a discontinuity every 10 numbers at the boundary between groups. So we then repeat the process 9 more times, with the groups slightly offset each time, now each of these new waveforms has a discontinuity every 10 numbers, but all the discontinuities are at different spots, and when we mix together all of these waveforms, we get something that is smooth (not true in general, but true in this case). This is what I call a sorting filter. So what does a sorting filter actually do to a sound?
Basically, it will will harshen high frequency sounds. If you have a sine wave that is of a high enough frequency, the sorting filter will turn it into a triangular wave, while a lower frequency sine wave gets through without any trouble. Since the filter is non-linear(*), this doesn't mean that the filtered high+low frequency sound will be a high frequency triangular wave and a low frequency sine wave.
I also modified the filter so that when you sort, you can sort either ascending or descending depending on whether the first sample in this window is above or below the last sample. This gives us 2 variables we can tweak with the filter - the width (how wide the window is) and the sorting policy (always ascend, always descend, same as first/last, opposite to first/last).
So I'm not quite sure how to demonstrate the workings of it. I had four 10 second long clips of audio which I've used as test dummies. I tried to pick different sounding things, you get 3 points for every song you know. The current best score is 12 (by me). I then filtered them, 8 times - 2 different window sizes (10 and 50) and 4 different sorting choices (always ascend, always descend, follow trend between first and last, disobey trend between first and last).
So this recording is just a few of the demonstrations put together in this order (no S or K samples in here, the S ones sound pretty bad, there are some ok K ones)
T(original) T(ascend10) T(oppose10) M(original) M(ascend10) M(follow10) M(oppose10) M(follow50) M(oppose50)
Things to listen for:
- Listen to the hi-hat (or lack of) in the T samples.
- Note how the kick drum in the M samples stays big.
- Both of the ascend10 filters pretty much destroy the hi-hat.
- The snare drum in M(follow50)
You will probably hear these and think a lot of them sound rubbish, and there is no possible use for them. You wouldn't take one of these filters and apply it to an entire track, but I can definitely imagine mixing in a little bit of one of these to a track to add something different.
If you want to hear the rest of the sounds, or play with the source (it compiles cleanly with amkel and is GPL2) then get the whole sorting filter package
(*) A linear process is one where if you apply it to two signals separately and then mix the results together you get the same result as if you mixed the two signals together and then applied the process. (for the maths people, f is linear if f(a) + f(b) = f(a + b)) (**)
(**) This isn't quite the textbook definition of linear process. They also include the requirement that if you apply it to a signal which has been multiplied by a constant, then the result is the same as if you applied it to the original signal and then multiplied the result by that constant (or f(kx) = kf(x)). But to me, the number of interesting things where the first condition is true and this condition isn't is so small that I don't really bother caring about this one.

RSS