Harmony Central Forums
Announcement Announcement Module
Collapse
No announcement yet.

How to compress with a spectral mirror image?

Page Title Module
Move Remove Collapse







X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to compress with a spectral mirror image?

    I downloaded an .flv off the internet that upon inspection, only has "true" audio fequencies up to 10000Hz but uses a mirror image of those frequencies to fill out the remaining frequencies up to 20000Hz. For example, 8000Hz stuff also appears at 12000Hz as a mirror image. The mirror image seems perfect, with none of the time innaccuracies introduced when using typical pitch raising software.

    Can anyone tell me how to do this? I know it's possible now that I've seen it done. Apparently this allows the .flv to get away with only encoding half the frequencies while the other frequencies are faked...which is why I referred to it as a compression technogy. Internet searches have not helped me out.

  • #2
    programming wise it's a simple use of (this is all logical shorthand not a real programming language)

    count = 0
    input_sample_position = 0
    output_sample_position = 0
    output_compressed_sample = 00 (it's hex)
    input_buffer = 00
    output_buffer = 00
    temp_sample_1 = 00
    temp_sample_2 = 00

    do loop while input_sample_position < 20,000
    temp_sample_1 = input_buffer at input_sample_position
    input_sample_position = input_sample_position +1
    temp_sample_2 = input_buffer at input_sample_position
    output_compressed_sample = (temp_sample_1 + temp_sample_2) / 2
    write output_compressed_sample to output_buffer at input_sample_position -1
    input_sample_position = input_sample_position + 1
    repeat loop


    and that's the logic behind the creation of the half compresed sample

    the playback is simply

    count = 0
    sample_position_2 = 0
    temp_1 = 00


    do loop while count < 10,000

    temp_1 = read file at count
    sample_position_2 = 20,000 - count
    write to audio buffer at count temp_1
    write to audio buffer at sample_position_2 temp_1

    count = count +1

    repeat loop
    <div class="signaturecontainer">there are three basic rules in business...<br />
    1.)always remember where you come from so you'll know where your going.<br />
    2.)never reveal everything you know.<br />
    <br />
    he also deleted my sig which read &quot;Paolo Di Necaerrewhatever: level headed intelligent moderation since.... well hopefully sometime in the near future&quot; haha...</div>

    Comment


    • #3
      programming wise it's a simple use of (this is all logical shorthand not a real programming language)


      Thanks for the reply. I enjoyed reading that over and picking up what I could about the logic employed in your quasi-code. But, and you probably guessed this but answered anyway, I really just meant "anyone know what software will do it". I'm not qualified for the programming aspect of it. I re-read my original message and I can see now I wasn't clear enough on that.

      As a side note, the way I noticed the mirror image thing being employed was likely a faked compression. Information wasn't averaged, it was actually lost (a low-pass filter at 10KHz). Also, I'm assuming you meant for your top part of your code (which looked like a way of converting from 20Khz to 10Khz sample frequency) to be outputted as data that would represent amplitude of every other frequency relative to the original sample frequency, otherwise you'd just be lowering pitch...moving everything that was between 0-10Khz down in between 0-5Khz, for example.

      Anyway, thanks for the detailed reply. Though anyone else that thinks they know of software that'll do it, please let me know.

      Comment


      • #4
        yeah it's basicaly you ditch every other sample and halve the information then fill it in later with a flip flop interleave of identical data.
        it basically takes a 20 khz signal down to 10 khz but includes half the information representing that upper 10 khz range also.

        as far as software to do this no there isn't anything comercially available.
        however you can achieve much the same result useing 1/4 the rate say in an mp3. going from instead of 256k rate go with 64k rate.

        fake mono to stereo stuff also exists for streaming applications that will cut the signal in half.

        unless you have a web site and expect lots of low bandwidth users one has to ask why you'd wan't to use this in audio. if it's for copyright protection a simple muxed low amplitude signal mixed in will do the same thing.
        <div class="signaturecontainer">there are three basic rules in business...<br />
        1.)always remember where you come from so you'll know where your going.<br />
        2.)never reveal everything you know.<br />
        <br />
        he also deleted my sig which read &quot;Paolo Di Necaerrewhatever: level headed intelligent moderation since.... well hopefully sometime in the near future&quot; haha...</div>

        Comment


        • #5
          Yeah, I've been misleading I guess only referring to it all in terms of compression. The real reason why I was interested is to fix live concerts I've run across that are missing frequencies above, say, 11000Hz (sometimes because they were sourced from a web stream). Pitch shifting a copy of the 9-11KHz stuff up kind of helps a little, but there's time innacuracies and artifacts that get introduced so you can only do it subtly. To my ears, the mirror imaged bit (which ridiculously puts a copy of everything from 0-1000Khz up at 19-20Khz...but not many can hear that high anyway...and you could still just cut those super high frequencies out at the end) just sounds much cleaner and natural...even though it's totally fake. And looking at the spectral image, it looks like a perfect mirror image.

          I should have explained more in the first post, but I typically like to keep a post like that to the point without a lot of backstory, probably this time I didn't give enough. Anyway, thanks for the input.

          Comment

          Working...
          X