Wedge of Cheese

Profile posts Postings About

  • What is G6 and how is it different from G/Gm/Gdim etc.
    Wedge of Cheese
    Wedge of Cheese
    I'm now going to do what I didn't do before and prove that these two filters are in fact complimentary. However, in order for it to work right, I have to split the first line of the highpass into two lines:

    output+=input-prevInput;
    output-=2*Math.PI*cutoffFreq*output/samplingRate;

    At first glance, this may appear to be equivalent to the earlier version, but notice that, now, once the 2nd line of code is reached, the value of output has changed by input-prevInput. I'm allowed to make this change because, as delta_t approaches zero, the two versions converge on being equivalent (and in practice delta_t is very small).

    This change is equivalent to leaving the 1st line as 1 line, but replacing the 2nd "output" with "(output+input-prevInput)".

    So, we're going to prove the complimentariness of the filters inductively.

    We want to prove that, at every sample frame, the sum of the two outputs is the input. We'll assume both outputs and the input start at zero (and hence prevInput starts at zero).

    For the sake of brevity, I will replace 2*Math.PI*cutoffFreq/samplingRate with k for now.

    output_LP=prevOutput_LP+(input-prevOutput_LP)*k
    output_HP=prevOutput_HP+input-prevInput-k*(prevOutput_HP+input-prevInput)
    prevOutput_LP+prevOutput_HP=prevInput

    We want to prove that, if the above 3 statements are true, then output_LP+output_HP=prevInput

    First, factor a prevout+in-previn out of the HP equation:
    output_HP=(prevOutput_HP+input-prevInput)*(1-k)

    Notice that prevoutHP-previn=-prevoutLP, so we can rewrite the above as:
    output_HP=(input-prevOutputLP)*(1-k)
    output_HP=input*(1-k)-prevOutputLP*(1-k)

    Next, rewrite the LP equation like so:
    output_LP=prevOutput_LP+input*k-prevOutput_LP*k
    output_LP=input*k+prevOutput_LP*(1-k)

    Finally, add the two equations and simplify:
    output_LP+output_HP=input*k+input*(1-k)+prevOutputLP*(1-k)-prevOutputLP*(1-k)
    output_LP+output_HP=input*(k+(1-k))
    output_LP+output_HP=input*1
    output_LP+output_HP=input

    Q. E. frickin' D.



    I'm about to go write a Java app so you can actually HEAR what these filters sound like, rather than just looking at it from a theoretical standpoint, but first there's one more thing I'd like to point out.

    Notice what happens when k is equal to 1. Our Java code simplifies down to the following:

    //lowpass
    output+=(input-output);

    //highpass
    output+=input-prevInput;
    output-=output;
    prevInput=input;

    which simplifies further to:

    //lowpass
    output=input;

    //highpass
    output=0;

    This means that, in practice, if cutoffFreq*2*pi is equal to the sampling rate, the lowpass filter does absolutely no filtering, allowing the input to pass through unmodified, and the highpass filter does complete filtering, allowing no sound to pass through, even though, in theory, this shouldn't happen. The opposite happens when k=0, though this is "supposed" to happen, both in theory and in practice. Weird stuff happens if k>1, so you should limit the cutoff frequencies of your filters to samplingRate/(2*pi). You may be able to generate cool effects by having the cutoff higher than this, but that would make the the audio output sound drastically different depending on the sampling rate, which is generally considered bad design (it's nice to be able to just adjust the sampling rate willy nilly without odd consequences).
    Wedge of Cheese
    Wedge of Cheese
    <a href='http://www.mediafire.com/?s4596ixh8py621x' class='bbc_url' title='External link' rel='nofollow external'>http://www.mediafire...s4596ixh8py621x</a>

    On my computer, it stutters at 40 kHz, does it do the same for you?
    Lace
    Lace
    No stutters for this chap
    Elemenion is my new fav woc song
    Lace
    Lace
    also y u no postathon
    Wedge of Cheese
    Wedge of Cheese
    Huzzah for name fixes and elemenion appreciation (although you still show up as jellysex in my notification list). And no postathon cuz of this annoying little thing called "college". Will continue on Friday methinks.
    Heyyyyyyyyy buddy!
    Wanna go dungeoneering with my alt?
    It will be so much fun!
    I never actually figured it out myself, I just stumbled on the hex while I was perusing the internets one day and applied it to my exe. I think Jackalope might have figured it out, they mentioned it a couple days ago in IRC.
    Fun fact: pttune can be opened by pxtone collage with the aid of a small hack, and the only thing they are missing is the names of the instruments and voices (since they're not "supposed" to be accessible)
    I also woulda thunk that two seperate devices were created, (one for each instrument) but I guess I was wrong.
    Ramsay Bolton likes removing peoples' skin.
    You have no idea how painful that is until it happens to you (even in an admittedly small amount).
    Then
    I believe the screwy bit is where you divide by the sampling rate.

    Also.
    There is a folder in this file with my name on it.
    I was unaware I had made an org entitled ick ickybtang.
    Or in fact any of these.

    They sound godawful D:
  • Loading…
  • Loading…
Top