Sine Waves in Lossless?

jakelm
jakelm Posts: 4,081
edited January 2008 in DIY, Mods & Tweaks
This might sound crazy, but:

Would it make a difference? Has anyone recorded in lossless format and found callibration and Fr sweep plotting to be more accurate?
Is there a such thing as lossless format for sine waves?
Monitor 7b's front
Monitor 4's surround
Frankinpolk Center (2 mw6503's with peerless tweeter)
M10's back surround
Hafler-200 driving patio Daytons
Tempest-X 15" DIY sub w/ Rythmik 350A plate amp
Dayton 12" DVC w/ Rythmik 350a plate amp
Harman/Kardon AVR-635
Oppo 981hd
Denon upconvert DVD player
Jennings Research (vintage and rare)
Mit RPTV WS-55513
Tosh HD-XA1
B&K AV5000


Dont BAN me Bro!!!!:eek:
Post edited by jakelm on
«1

Comments

  • Face
    Face Posts: 14,340
    edited January 2008
    I'm sure you could find them if you purchased a set up CD and ripped them to lossless. ;)
    "He who fights with monsters should look to it that he himself does not become a monster. And when you gaze long into an abyss the abyss also gazes into you." Friedrich Nietzsche
  • nms
    nms Posts: 671
    edited January 2008
    Is there a such thing as lossless format for sine waves?

    Yeah, it's called a signal generator :)
    My system

    "The world is an ever evolving clusterf*ck." --treitz3
  • unc2701
    unc2701 Posts: 3,587
    edited January 2008
    It been awhile since I've seen the math on the MP3 format, but I'm pretty certain that a single pure sine wave wouldn't end up being compressed at all- it'd effectively be lossless.
    Gallo Ref 3.1 : Bryston 4b SST : Musical fidelity CD Pre : VPI HW-19
    Gallo Ref AV, Frankengallo Ref 3, LC60i : Bryston 9b SST : Meridian 565
    Jordan JX92s : MF X-T100 : Xray v8
    Backburner:Krell KAV-300i
  • jakelm
    jakelm Posts: 4,081
    edited January 2008
    unc2701 wrote: »
    It been awhile since I've seen the math on the MP3 format, but I'm pretty certain that a single pure sine wave wouldn't end up being compressed at all- it'd effectively be lossless.

    It was a crazy thought I know. I couldnt figure out how it could be compressed. But , I had to suck it up and ask.
    Monitor 7b's front
    Monitor 4's surround
    Frankinpolk Center (2 mw6503's with peerless tweeter)
    M10's back surround
    Hafler-200 driving patio Daytons
    Tempest-X 15" DIY sub w/ Rythmik 350A plate amp
    Dayton 12" DVC w/ Rythmik 350a plate amp
    Harman/Kardon AVR-635
    Oppo 981hd
    Denon upconvert DVD player
    Jennings Research (vintage and rare)
    Mit RPTV WS-55513
    Tosh HD-XA1
    B&K AV5000


    Dont BAN me Bro!!!!:eek:
  • Face
    Face Posts: 14,340
    edited January 2008
    I have some test tones on my PC in PCM format, about 700kbs. Lossless isn't much higher.
    "He who fights with monsters should look to it that he himself does not become a monster. And when you gaze long into an abyss the abyss also gazes into you." Friedrich Nietzsche
  • jakelm
    jakelm Posts: 4,081
    edited January 2008
    Face wrote: »
    I have some test tones on my PC in PCM format, about 700kbs. Lossless isn't much higher.


    Lossless is about 900+
    Monitor 7b's front
    Monitor 4's surround
    Frankinpolk Center (2 mw6503's with peerless tweeter)
    M10's back surround
    Hafler-200 driving patio Daytons
    Tempest-X 15" DIY sub w/ Rythmik 350A plate amp
    Dayton 12" DVC w/ Rythmik 350a plate amp
    Harman/Kardon AVR-635
    Oppo 981hd
    Denon upconvert DVD player
    Jennings Research (vintage and rare)
    Mit RPTV WS-55513
    Tosh HD-XA1
    B&K AV5000


    Dont BAN me Bro!!!!:eek:
  • Face
    Face Posts: 14,340
    edited January 2008
    Correct, lossless usually is from 900 to 1100ish. As long as decent ripping software is used, I doubt your ears would be able to tell the difference from 700 to 900 unless you're a Vampire.:D Now if it was 128 to 320k, that would be night and day. 320 to lossless isn't a huge difference depending on the ripping software.
    "He who fights with monsters should look to it that he himself does not become a monster. And when you gaze long into an abyss the abyss also gazes into you." Friedrich Nietzsche
  • jakelm
    jakelm Posts: 4,081
    edited January 2008
    Then we get back to: How would a sine wave be compressed?
    Monitor 7b's front
    Monitor 4's surround
    Frankinpolk Center (2 mw6503's with peerless tweeter)
    M10's back surround
    Hafler-200 driving patio Daytons
    Tempest-X 15" DIY sub w/ Rythmik 350A plate amp
    Dayton 12" DVC w/ Rythmik 350a plate amp
    Harman/Kardon AVR-635
    Oppo 981hd
    Denon upconvert DVD player
    Jennings Research (vintage and rare)
    Mit RPTV WS-55513
    Tosh HD-XA1
    B&K AV5000


    Dont BAN me Bro!!!!:eek:
  • lanion
    lanion Posts: 843
    edited January 2008
    a pure sine wave can be reproduced by a highly compressed file -- that is the way MP3 encoding works. Modern audio compression is based on Discrete Cosine Transforms. A pure sine wave only takes a few bits. I did some research as an undergrad trying to compare AAC, MP3, etc... any by generating various test tones and harmonics I was not able to loose ANY information, but the most complicated I got generating signals was a 5hz sine wave * a 10hz sine wave * a 20hz sine wave up to 20khz. This is quite simple and MP3 and AAC had no problem reproducing it, even with high compression.
    My Iron Man training/charity blog.

    HT:
    32" Sharp LCD. H/K dpr 1001 to Outlaw Audio 7900 to Polk LSi + Paradigm Studio center. Hsu DualDrive ULS-15. PS3/Wii. Outlaw 7900.
  • heiney9
    heiney9 Posts: 25,194
    edited January 2008
    Face wrote: »
    I have some test tones on my PC in PCM format, about 700kbs. Lossless isn't much higher.

    Ummmm....lossless (FLAC-true lossless) has the same bit rate as a regular .wav or .cda file. Which is 1411kbps.

    H9
    "Appreciation of audio is a completely subjective human experience. Measurements can provide a measure of insight, but are no substitute for human judgment. Why are we looking to reduce a subjective experience to objective criteria anyway? The subtleties of music and audio reproduction are for those who appreciate it. Differentiation by numbers is for those who do not".--Nelson Pass Pass Labs XA25 | EE Avant Pre | EE Mini Max Supreme DAC | MIT Shotgun S1 | Pangea AC14SE MKII | Legend L600 | BlueSound Node 3 - Tubes add soul!
  • Face
    Face Posts: 14,340
    edited January 2008
    heiney9 wrote: »
    Ummmm....lossless (FLAC-true lossless) has the same bit rate as a regular .wav or .cda file. Which is 1411kbps.

    H9
    He didn't specify which lossless. I rip all my music to WMP lossless, which can be from 550 to a little over 1100. I've never seen anything close to 1400.
    "He who fights with monsters should look to it that he himself does not become a monster. And when you gaze long into an abyss the abyss also gazes into you." Friedrich Nietzsche
  • heiney9
    heiney9 Posts: 25,194
    edited January 2008
    Face wrote: »
    He didn't specify which lossless. I rip all my music to WMP lossless, which can be from 550 to a little over 1100. I've never seen anything close to 1400.

    Not to split hairs but it's not true lossless then. This discussion had been had before. I prefer to use only FLAC as Apple lossless isn't a true bit for bit copy and neither is WMP it appears.

    1411 kbps is the standard .wav and .cda music file anything less in my mind is not lossless because the "lost" bits went somewhere. Again I don't want to get into a big discussion because this has all been covered before.

    My personal preference is EAC --> FLAC for my own personal ripped music for use on my computer/office system. It's a bit perfect copy of the original every time.

    H9
    "Appreciation of audio is a completely subjective human experience. Measurements can provide a measure of insight, but are no substitute for human judgment. Why are we looking to reduce a subjective experience to objective criteria anyway? The subtleties of music and audio reproduction are for those who appreciate it. Differentiation by numbers is for those who do not".--Nelson Pass Pass Labs XA25 | EE Avant Pre | EE Mini Max Supreme DAC | MIT Shotgun S1 | Pangea AC14SE MKII | Legend L600 | BlueSound Node 3 - Tubes add soul!
  • Face
    Face Posts: 14,340
    edited January 2008
    Thanks for the info. I had trouble installing EAC on my machine. Maybe I'll give it another try..

    What do you use for playback? I'm currently using Foobar.
    "He who fights with monsters should look to it that he himself does not become a monster. And when you gaze long into an abyss the abyss also gazes into you." Friedrich Nietzsche
  • Phasearray
    Phasearray Posts: 437
    edited January 2008
    Wouldn't any kind of digital converting technique introduce distortion since the stuff being sample is Aperiodic?
    Receiver - Onkyo HT-R340
    Front - Pioneer S-HF21
    Center -Onkyo SKC-340C
    Surround Back - Polk R15 <--Ticket to club polk
    Subwoofer - Onkyo SKW-340
  • heiney9
    heiney9 Posts: 25,194
    edited January 2008
    Phasearray wrote: »
    Wouldn't any kind of digital converting technique introduce distortion since the stuff being sample is Aperiodic?

    No, please explain. All digital has to be converted to analog for us to hear it so every CDP and DVDp converts digital to analog.

    When ripping cds it's an all digital process until you use something to convert it to analog. Certainly using an inferior DAC can cause distortion but that's the fault of the converter not being properly designed and/or using inferior parts, not the actual process per se.

    H9
    "Appreciation of audio is a completely subjective human experience. Measurements can provide a measure of insight, but are no substitute for human judgment. Why are we looking to reduce a subjective experience to objective criteria anyway? The subtleties of music and audio reproduction are for those who appreciate it. Differentiation by numbers is for those who do not".--Nelson Pass Pass Labs XA25 | EE Avant Pre | EE Mini Max Supreme DAC | MIT Shotgun S1 | Pangea AC14SE MKII | Legend L600 | BlueSound Node 3 - Tubes add soul!
  • jakelm
    jakelm Posts: 4,081
    edited January 2008
    heiney9 wrote: »
    No, please explain. All digital has to be converted to analog for us to hear it so every CDP and DVDp converts digital to analog.

    When ripping cds it's an all digital process until you use something to convert it to analog. Certainly using an inferior DAC can cause distortion but that's the fault of the converter not being properly designed and/or using inferior parts, not the actual process per se.

    H9


    +1. All music needs to become physical (analog) for us to hear. Good explanation H9.

    I have found that 99% of the time, its not so much a bad recording as it is the DAC equipments fault.
    Monitor 7b's front
    Monitor 4's surround
    Frankinpolk Center (2 mw6503's with peerless tweeter)
    M10's back surround
    Hafler-200 driving patio Daytons
    Tempest-X 15" DIY sub w/ Rythmik 350A plate amp
    Dayton 12" DVC w/ Rythmik 350a plate amp
    Harman/Kardon AVR-635
    Oppo 981hd
    Denon upconvert DVD player
    Jennings Research (vintage and rare)
    Mit RPTV WS-55513
    Tosh HD-XA1
    B&K AV5000


    Dont BAN me Bro!!!!:eek:
  • heiney9
    heiney9 Posts: 25,194
    edited January 2008
    Face wrote: »
    Thanks for the info. I had trouble installing EAC on my machine. Maybe I'll give it another try..

    What do you use for playback? I'm currently using Foobar.

    I use Foobar. I have a question. Are you looking at the number (given in kbps) at the bottom left margin of the Foobar program? Is that where you got your numbers from? The way Foobar works is it uncompresses on the fly so that number you are reading is what the FLAC file actually is not what the final output of Foobar is which is the standard 1411 kbps if you are playing FLAC files.

    So the compressed file "going in" to the Foobar program might be 710kbps but then Foobar decompresses the compressed FLAC file on the fly and the output signal is 1411kbps the same as .wav or .cda file.

    H9
    "Appreciation of audio is a completely subjective human experience. Measurements can provide a measure of insight, but are no substitute for human judgment. Why are we looking to reduce a subjective experience to objective criteria anyway? The subtleties of music and audio reproduction are for those who appreciate it. Differentiation by numbers is for those who do not".--Nelson Pass Pass Labs XA25 | EE Avant Pre | EE Mini Max Supreme DAC | MIT Shotgun S1 | Pangea AC14SE MKII | Legend L600 | BlueSound Node 3 - Tubes add soul!
  • unc2701
    unc2701 Posts: 3,587
    edited January 2008
    I think we could use a crude example of lossless, so we're all on the same page- Wav files tend to have a bunch of large numbers; frequently these large numbers are in the same range. A lossless compression simply takes advantage of this property.

    If the wav file has these numbers:
    16123 16888 16458 16200 16999 17456 16542 16456 16358 16255

    A lossless compression would, say, subtract 16000 from each, and have a designator that the subtraction of that particular number goes on for the next ten numbers, so the new file has this info:

    16000 10 123 888 458 200 999 1456 542 456 358 255

    Compare the length of that to the full numbers- it's shorter, but you didn't lose any info. The kbps displayed is the kbps of the shorter string, but the computer immediately changes the numbers back into the original ones. Thus, lossless. Now that example was very crude- a good lossless program will read back and forth and optimize this to get the file size way down. MP3, AAC, etc are different in that they throw away info- if two tones are close enough it doesn't think you can tell them apart, it throws away the quieter one.
    Gallo Ref 3.1 : Bryston 4b SST : Musical fidelity CD Pre : VPI HW-19
    Gallo Ref AV, Frankengallo Ref 3, LC60i : Bryston 9b SST : Meridian 565
    Jordan JX92s : MF X-T100 : Xray v8
    Backburner:Krell KAV-300i
  • jakelm
    jakelm Posts: 4,081
    edited January 2008
    I'll stick with my 96kbs. Sounds fabulous...;):D
    Monitor 7b's front
    Monitor 4's surround
    Frankinpolk Center (2 mw6503's with peerless tweeter)
    M10's back surround
    Hafler-200 driving patio Daytons
    Tempest-X 15" DIY sub w/ Rythmik 350A plate amp
    Dayton 12" DVC w/ Rythmik 350a plate amp
    Harman/Kardon AVR-635
    Oppo 981hd
    Denon upconvert DVD player
    Jennings Research (vintage and rare)
    Mit RPTV WS-55513
    Tosh HD-XA1
    B&K AV5000


    Dont BAN me Bro!!!!:eek:
  • heiney9
    heiney9 Posts: 25,194
    edited January 2008
    Very good explanation/example as that's basically how it works.

    A simpler one would be that true lossless compression work exactly like WinZip when compressing other files. It makes them shorter (via your explanation) for storage but then the exact original info can be retrieved by uncompressing.

    Lossy compression uses an algorithm that analyzes the music going in and discards parts that aren't useful (according to those who wrote the algorithm) and the file ends up being much much smaller. The end result is that parts of the original are missing and a true audiophile with a decent rig can hear that the missing info causes the file to sound different (usually worse) than the original.

    H9
    "Appreciation of audio is a completely subjective human experience. Measurements can provide a measure of insight, but are no substitute for human judgment. Why are we looking to reduce a subjective experience to objective criteria anyway? The subtleties of music and audio reproduction are for those who appreciate it. Differentiation by numbers is for those who do not".--Nelson Pass Pass Labs XA25 | EE Avant Pre | EE Mini Max Supreme DAC | MIT Shotgun S1 | Pangea AC14SE MKII | Legend L600 | BlueSound Node 3 - Tubes add soul!
  • lanion
    lanion Posts: 843
    edited January 2008
    jakelm wrote: »
    This might sound crazy, but:

    Would it make a difference? Has anyone recorded in lossless format and found callibration and Fr sweep plotting to be more accurate?
    Is there a such thing as lossless format for sine waves?

    I have done this. Using MP3 and AAC at 128k it is lossless for simple waves. Comparing Discrete Cosine Transform compression to a .zip file isn't that good.

    In MP3 compression a pure sine wave would only be expressed by a few bits as it is periodic, and all audio codecs were designed with periodicity in mind. Thus, with anything less complicated than recorded sounds (electronic tones) it is essentially lossless even using a very low bit rate.
    My Iron Man training/charity blog.

    HT:
    32" Sharp LCD. H/K dpr 1001 to Outlaw Audio 7900 to Polk LSi + Paradigm Studio center. Hsu DualDrive ULS-15. PS3/Wii. Outlaw 7900.
  • jakelm
    jakelm Posts: 4,081
    edited January 2008
    Would distortion play a role if a single sine wave were to be compressed too much?
    Monitor 7b's front
    Monitor 4's surround
    Frankinpolk Center (2 mw6503's with peerless tweeter)
    M10's back surround
    Hafler-200 driving patio Daytons
    Tempest-X 15" DIY sub w/ Rythmik 350A plate amp
    Dayton 12" DVC w/ Rythmik 350a plate amp
    Harman/Kardon AVR-635
    Oppo 981hd
    Denon upconvert DVD player
    Jennings Research (vintage and rare)
    Mit RPTV WS-55513
    Tosh HD-XA1
    B&K AV5000


    Dont BAN me Bro!!!!:eek:
  • Phasearray
    Phasearray Posts: 437
    edited January 2008
    heiney9 wrote: »
    No, please explain. All digital has to be converted to analog for us to hear it so every CDP and DVDp converts digital to analog.

    H9

    Will, I was thinking, a pure sin wave in the analog domain is a delta function in the frequency domain. Therefore, a pure sinwave has to be sampled infinitely long to know that it's a sinwave? Or is it for the most part a sinwave in an audio clip is long enough that there is enough sample on it to be very accurate?
    Receiver - Onkyo HT-R340
    Front - Pioneer S-HF21
    Center -Onkyo SKC-340C
    Surround Back - Polk R15 <--Ticket to club polk
    Subwoofer - Onkyo SKW-340
  • Face
    Face Posts: 14,340
    edited January 2008
    heiney9 wrote: »
    I use Foobar. I have a question. Are you looking at the number (given in kbps) at the bottom left margin of the Foobar program? Is that where you got your numbers from? The way Foobar works is it uncompresses on the fly so that number you are reading is what the FLAC file actually is not what the final output of Foobar is which is the standard 1411 kbps if you are playing FLAC files.
    Yes, I was going by those numbers, but I'm using WMP lossless.
    "He who fights with monsters should look to it that he himself does not become a monster. And when you gaze long into an abyss the abyss also gazes into you." Friedrich Nietzsche
  • bernardo
    bernardo Posts: 120
    edited January 2008
    Just my $0.02
    Hope this is useful. I think it is relevant, unless I misunderstood all of the above, which (of course) is entirely possible

    We have mentioned DCT, delta functions, DACs, etc. a big mess :)

    There are several signals involved in all this:
    1) the analog sinusoidal signal of infinite duration into the future and back into the past (analog amplitude and continuous time)
    2) the discrete-time analog amplitude signal also infinite duration
    3) the discrete-time discrete amplitude signal (AKA digital) non-infinite signal stored in the CD (or computer)
    4) the compressed digital signal (lossless or lossy)

    There is not much information in a sine wave, in fact only 3 numbers will do as long as you know what to do with them; e.g., with amplitude (A), frequency(f) and phase you do A*sin(2*pi*f*t+phase) for every t you can think of.

    For 1, doing some engineering hand-waving (a math guy would be outraged) you have the Fourier transform as 2 delta function at w=2*pi*f and -w.
    Sampling 1 for infinite time gives 2. Using the sampling theorem (I'm not getting into names as to who came up with this :) ) we need to sample only at twice the frequency and we will be able to recover 1 perfectly. This signal has a transform usually known as DTFT (Discrete time Fourier transform).
    Then there's the DFT and the FFT wich assume a periodic signal which in the case of a sine wave is true, so you really need one period's samples at twice the frequency.
    Still if you know how, you can get 1 back until you quantize the amplitude...
    Number 3 would be samples of 1 at 44,100 samples per second, 2 bytes per sample per channel for a finite duration. In theory we could compress 3 by removing samples without loosing any info: we really only need twice the freq. of the signal. So, just because the kbps is low it does not mean it is lossy in the very specific case of a sine wave (or other band limited signals, assuming there's no high frequency noise that because of aliasing appears at low frequencies thereby distorting them and making recovery of the original impossible).

    Going from 4 to 3 to DAC would not be a problem. But if your DAC is a ZOH and you feed it 4 in this way you would probably see a very bad staircase.

    Discrete Cosine Transform if I remember correctly is also lossless, the loss in MP3 does not come because of the (modified)DCT itself. Part of the loss comes because of quantizing the results of the DCT I believe.

    So yes there is such a thing as a lossless format for sine waves; e.g., process 3 with flac to get 4.
    How much difference does it make? You are probably thinking MP3 but it could be a number of other lossy codecs like vorbis.
    If you want the answer to this one you will have to follow the algorithm of mp3 for example, including windows to reduce edge effects, psychoacoustic model and all! So maybe an experimental approach is more appealing(?). I would think that for sine waves you would not loose much as lanion's experiments tend to indicate.
  • jakelm
    jakelm Posts: 4,081
    edited January 2008
    bernardo wrote: »
    Just my $0.02
    Hope this is useful. I think it is relevant, unless I misunderstood all of the above, which (of course) is entirely possible

    We have mentioned DCT, delta functions, DACs, etc. a big mess :)

    There are several signals involved in all this:
    1) the analog sinusoidal signal of infinite duration into the future and back into the past (analog amplitude and continuous time)
    2) the discrete-time analog amplitude signal also infinite duration
    3) the discrete-time discrete amplitude signal (AKA digital) non-infinite signal stored in the CD (or computer)
    4) the compressed digital signal (lossless or lossy)

    There is not much information in a sine wave, in fact only 3 numbers will do as long as you know what to do with them; e.g., with amplitude (A), frequency(f) and phase you do A*sin(2*pi*f*t+phase) for every t you can think of.

    For 1, doing some engineering hand-waving (a math guy would be outraged) you have the Fourier transform as 2 delta function at w=2*pi*f and -w.
    Sampling 1 for infinite time gives 2. Using the sampling theorem (I'm not getting into names as to who came up with this :) ) we need to sample only at twice the frequency and we will be able to recover 1 perfectly. This signal has a transform usually known as DTFT (Discrete time Fourier transform).
    Then there's the DFT and the FFT wich assume a periodic signal which in the case of a sine wave is true, so you really need one period's samples at twice the frequency.
    Still if you know how, you can get 1 back until you quantize the amplitude...
    Number 3 would be samples of 1 at 44,100 samples per second, 2 bytes per sample per channel for a finite duration. In theory we could compress 3 by removing samples without loosing any info: we really only need twice the freq. of the signal. So, just because the kbps is low it does not mean it is lossy in the very specific case of a sine wave (or other band limited signals, assuming there's no high frequency noise that because of aliasing appears at low frequencies thereby distorting them and making recovery of the original impossible).

    Going from 4 to 3 to DAC would not be a problem. But if your DAC is a ZOH and you feed it 4 in this way you would probably see a very bad staircase.

    Discrete Cosine Transform if I remember correctly is also lossless, the loss in MP3 does not come because of the (modified)DCT itself. Part of the loss comes because of quantizing the results of the DCT I believe.


    The only thing I understood is quoted below:confused:, thanks for making me feel stupid...lol:mad:
    So yes there is such a thing as a lossless format for sine waves; e.g., process 3 with flac to get 4.
    How much difference does it make? You are probably thinking MP3 but it could be a number of other lossy codecs like vorbis.
    If you want the answer to this one you will have to follow the algorithm of mp3 for example, including windows to reduce edge effects, psychoacoustic model and all! So maybe an experimental approach is more appealing(?). I would think that for sine waves you would not loose much as lanion's experiments tend to indicate.
    Monitor 7b's front
    Monitor 4's surround
    Frankinpolk Center (2 mw6503's with peerless tweeter)
    M10's back surround
    Hafler-200 driving patio Daytons
    Tempest-X 15" DIY sub w/ Rythmik 350A plate amp
    Dayton 12" DVC w/ Rythmik 350a plate amp
    Harman/Kardon AVR-635
    Oppo 981hd
    Denon upconvert DVD player
    Jennings Research (vintage and rare)
    Mit RPTV WS-55513
    Tosh HD-XA1
    B&K AV5000


    Dont BAN me Bro!!!!:eek:
  • Phasearray
    Phasearray Posts: 437
    edited January 2008
    bernardo wrote: »
    Just my $0.02
    Hope this is useful. I think it is relevant, unless I misunderstood all of the above, which (of course) is entirely possible

    We have mentioned DCT, delta functions, DACs, etc. a big mess :)

    There are several signals involved in all this:
    1) the analog sinusoidal signal of infinite duration into the future and back into the past (analog amplitude and continuous time)
    2) the discrete-time analog amplitude signal also infinite duration
    3) the discrete-time discrete amplitude signal (AKA digital) non-infinite signal stored in the CD (or computer)
    4) the compressed digital signal (lossless or lossy)

    There is not much information in a sine wave, in fact only 3 numbers will do as long as you know what to do with them; e.g., with amplitude (A), frequency(f) and phase you do A*sin(2*pi*f*t+phase) for every t you can think of.

    For 1, doing some engineering hand-waving (a math guy would be outraged) you have the Fourier transform as 2 delta function at w=2*pi*f and -w.
    Sampling 1 for infinite time gives 2. Using the sampling theorem (I'm not getting into names as to who came up with this :) ) we need to sample only at twice the frequency and we will be able to recover 1 perfectly. This signal has a transform usually known as DTFT (Discrete time Fourier transform).
    Then there's the DFT and the FFT wich assume a periodic signal which in the case of a sine wave is true, so you really need one period's samples at twice the frequency.
    Still if you know how, you can get 1 back until you quantize the amplitude...
    Number 3 would be samples of 1 at 44,100 samples per second, 2 bytes per sample per channel for a finite duration. In theory we could compress 3 by removing samples without loosing any info: we really only need twice the freq. of the signal. So, just because the kbps is low it does not mean it is lossy in the very specific case of a sine wave (or other band limited signals, assuming there's no high frequency noise that because of aliasing appears at low frequencies thereby distorting them and making recovery of the original impossible).

    Going from 4 to 3 to DAC would not be a problem. But if your DAC is a ZOH and you feed it 4 in this way you would probably see a very bad staircase.

    Discrete Cosine Transform if I remember correctly is also lossless, the loss in MP3 does not come because of the (modified)DCT itself. Part of the loss comes because of quantizing the results of the DCT I believe.

    So yes there is such a thing as a lossless format for sine waves; e.g., process 3 with flac to get 4.
    How much difference does it make? You are probably thinking MP3 but it could be a number of other lossy codecs like vorbis.
    If you want the answer to this one you will have to follow the algorithm of mp3 for example, including windows to reduce edge effects, psychoacoustic model and all! So maybe an experimental approach is more appealing(?). I would think that for sine waves you would not loose much as lanion's experiments tend to indicate.

    Nice write up! I admit that I need to go back and read my DSP stuff. Haven't touched the stuff since I graduated several years ago. so what do you have against Nyquist?
    Receiver - Onkyo HT-R340
    Front - Pioneer S-HF21
    Center -Onkyo SKC-340C
    Surround Back - Polk R15 <--Ticket to club polk
    Subwoofer - Onkyo SKW-340
  • Phasearray
    Phasearray Posts: 437
    edited January 2008
    jakelm wrote: »
    The only thing I understood is quoted below:confused:, thanks for making me feel stupid...lol:mad:

    My shallow understanding of DSP from an undergrad level is,

    Correlation - comparing two signals. If you have two identical signals and you correlate them, the result is the maximum applitude, this is also refer to as the match filter. If you have two very different signals and you correlate them, the result is a very low signal. So when you correlate two signals and the result is a high amplitude, you can say that the two signals are faily alike or very different of the resulting amplitude is low.

    Fourrier Transform - Concept is fairly easy to understand. Suppose I've sampled a single frequency signal. I have no idea what frequency it is. To figure out the frequency of the signal I "correlate it to other frequencies" Suppose I'm sampling a 1KHZ sine wave. When I correlate it to a 1 hz, 200 hz, and 5KHZ sine wave, the resulting amplitude is low. When I correlate that 1Khz Sinewave to another 1Khz sine wave or something close (999 Hz, 1001 Hz, etc) the resulting amplitude is high. This process of comparing my signal to a bunch of different frequencies is call fourrier transform. Fast Fourrier Transform(FFT) is just a computer optimized way of doing this.

    The problem with the Digital Fourrier Transform is that I can't compare my sampled signal to every single HZ in existance. There's only a finite amount of comparisons I can do. If I sample a 990 Hz signal and correlate it to 1Khz, then I'll suffer some correlation lost here. I hate saying this because I don't know if I remember this correctly, bu I believe this is the limitation of doing a N-Point transform?
    Receiver - Onkyo HT-R340
    Front - Pioneer S-HF21
    Center -Onkyo SKC-340C
    Surround Back - Polk R15 <--Ticket to club polk
    Subwoofer - Onkyo SKW-340
  • jakelm
    jakelm Posts: 4,081
    edited January 2008
    Phasearray wrote: »
    Fourrier Transform - Concept is fairly easy to understand. Suppose I've sampled a single frequency signal. I have no idea what frequency it is. To figure out the frequency of the signal I "correlate it to other frequencies" Suppose I'm sampling a 1KHZ sine wave. When I correlate it to a 1 hz, 200 hz, and 5KHZ sine wave, the resulting amplitude is low. When I correlate that 1Khz Sinewave to another 1Khz sine wave or something close (999 Hz, 1001 Hz, etc) the resulting amplitude is high. This process of comparing my signal to a bunch of different frequencies is call fourrier transform. Fast Fourrier Transform(FFT) is just a computer optimized way of doing this.

    Are you talking about 2 sine waves being in "tune" with each other, in result higher amplitude? Or am I way off here.
    Monitor 7b's front
    Monitor 4's surround
    Frankinpolk Center (2 mw6503's with peerless tweeter)
    M10's back surround
    Hafler-200 driving patio Daytons
    Tempest-X 15" DIY sub w/ Rythmik 350A plate amp
    Dayton 12" DVC w/ Rythmik 350a plate amp
    Harman/Kardon AVR-635
    Oppo 981hd
    Denon upconvert DVD player
    Jennings Research (vintage and rare)
    Mit RPTV WS-55513
    Tosh HD-XA1
    B&K AV5000


    Dont BAN me Bro!!!!:eek:
  • Phasearray
    Phasearray Posts: 437
    edited January 2008
    jakelm wrote: »
    Are you talking about 2 sine waves being in "tune" with each other, in result higher amplitude? Or am I way off here.

    pretty much. 2 sinewave there are near in frequency will be in "tune" with each other. Correlating(comparing) a 500Hz sine wave and a 520Hz sine wave will yield a much higher amplitude than correlating a 500Hz sine wave with a 800Hz sine wave.

    Example of a Fourrier Transform. I input an unknown signal. I can then correlate that signal to 100, 200, 300, 400, 500, 600,...etc... etc... 1000Hz. I find that the output of my correlation has the highest amplitude when my signal is correlated with the 500Hz sine wave, thus I conclude that 500Hz is my closest match.

    Please keep in mind that this is based on my undergrad education over 5 years ago and I haven't touched this stuff since. I've probably misinterpreted some stuff but the basic concept hopefully I've explained well enough.
    Receiver - Onkyo HT-R340
    Front - Pioneer S-HF21
    Center -Onkyo SKC-340C
    Surround Back - Polk R15 <--Ticket to club polk
    Subwoofer - Onkyo SKW-340