Skip to main content

Topic: is fading in/out a lossy process? (Read 6062 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • unicorn20
  • [*]
is fading in/out a lossy process?
hey all you audio experts of the forum.
i've been interested in lossless music for a long time and i got almost all of my knowledge about it from this forum.
i have an issue that i'm trying to figure out, and i've searched everywhere possible for info about it but i couldn't find any.
so you guys are my last resort, i hope you can help...
here's the issue :

i download many lossless albums all the time (WAV,APE,ALAC,FLAC), but i only keep to myself those few songs (if any) from each album, those songs that i liked the most.
most albums are ripped with gap detection so they begin with silence and end with silence, but there are some albums that don't, albums such as :

mixed albums (where the songs dissolve into each other)
live albums (where the tracks begin and end with the audience clapping or shouting)
one track albums (where there are no gaps or pauses between tracks)

i find it very annoying to listen to songs that comes from albums like the above, so i fix it using audacity, i fade in, and fade out, add some silence if necessary (using the "generate - silence" option), the thing is i can't help thinking maybe i am turning this perfect lossless file into a lossy one, and by doing so actually creating a fake lossless (since i'm always exporting as flac), my ears can't hear any difference, but still, you know way more than i do about these things.

so please tell me, does the "fade in / fade out / add silence" processes make a lossless file lossy?

sorry if my english is bad, i hope it's understandable, and if you find any mistakes please correct me.

thanks
  • Last Edit: 19 February, 2013, 12:10:36 PM by unicorn20

  • halb27
  • [*][*][*][*][*]
is fading in/out a lossy process?
Reply #1
In a formal sense fading in/out is a lossy process - simply because the result of the process differs from the original.
In a practical sense it's a lossless process as you just change loudness of restricted ranges of the original in a well-behaved dynamic way.
So don't worry.
  • Last Edit: 19 February, 2013, 12:18:46 PM by halb27
lame3995o -Q1

  • Garf
  • [*][*][*][*][*]
  • Developer (Donating)
is fading in/out a lossy process?
Reply #2
Fade in and out is lossy. You cannot recover the original signal where the volume has been altered. This should be obvious if you consider the point where it faded to silence. You can't turn silence into music by amplyfing it.

Wouldn't a player with crossfading work better for this?

is fading in/out a lossy process?
Reply #3
Also, Audacity dithers everything by default, so if you haven't changed any settings your whole track is being modified.

  • jensend
  • [*][*][*]
is fading in/out a lossy process?
Reply #4
halb27, being different isn't what defines lossy, non-invertibility of the transformation is (exactly what Garf says about recovering the signal). Equivalently, you can ask "are there two inputs that are mapped to the same output?"

With infinite precision numbers, fade in/out would be lossless except for any samples which were transformed to perfect silence, since you could just amplify each non-silent sample by the amount you faded it. With floating-point formats, the entire fade will be lossy but the difference between the original and the "recovered" signal would be insignificant except for samples that were sent to either silence or denormals. With normal integer PCM the more you fade a sample the more bits of precision you're throwing away.
  • Last Edit: 19 February, 2013, 01:12:39 PM by jensend

is fading in/out a lossy process?
Reply #5
so please tell me, does the "fade in / fade out / add silence" processes make a lossless file lossy?

"fade in / fade out" is strictly speaking a lossy processing, but it doesn't make you file "lossy" in the sense that no lossy encoding is applied (like mp3, lossy encoding  get rid of lot information, according to some psychoacoustic principles).
In fact, everything between the fade in and fade out, would remain exactly the same ( "lossless" if you want to absolutely use that word)  , so if it makes your music listening more enjoyable, why not. Just don't expect to be able to restore the original file.
If you just add silence at begin/end of track, again the music would remain strictly the same, and at the bit level (unless you changed overall volume, sampling rate, bit depth , etc...).
  • Last Edit: 19 February, 2013, 01:34:43 PM by extrabigmehdi

  • halb27
  • [*][*][*][*][*]
is fading in/out a lossy process?
Reply #6
As far as I can see the OP doesn't want to restore the changed files back to the original version. Instead he's thinking about audible quality. My reply was on this basis: formally lossy (and of course also in a practical sense in case it's about recovering the original), but lossless in a practical sense when it's about audible deviations from the original (with the exception of the loudness change of course).

@andrew_berge: Yes, the dithering default of Audacity isn't nice. I fell into this trap, too, and hopefully I will never forget. Easy to change however.
  • Last Edit: 19 February, 2013, 01:36:16 PM by halb27
lame3995o -Q1

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
is fading in/out a lossy process?
Reply #7
if it makes your music listening more enjoyable, why not.
Because the same result can be achieved without altering one’s files at all by using a player with crossfading functionality designed specifically for this purpose.

Not that I care if someone needlessly alters their warez.

  • dhromed
  • [*][*][*][*][*]
is fading in/out a lossy process?
Reply #8
Andrew Berge's comment about dither is more important than any theoretical lossiness of fading, but I can't find anything in Audacity's preferences that unambiguously refers to dithering when saving to a compressed file.

  • halb27
  • [*][*][*][*][*]
is fading in/out a lossy process?
Reply #9
My problems with Audacity was when exporting to a wav file. Dither can be disabled with 'Preferences' 'Quality'. My experience was with an earlier version of Audacity though. Not sure whether this applies to the current version. Can be tested by importing a file and immediate exporting it to another filename. foobar has an  audio data comparison tool. Audio data should be identical.
lame3995o -Q1

  • unicorn20
  • [*]
is fading in/out a lossy process?
Reply #10
wow, you guys are quick hehehe
well, thank you all for answering, and i sure have learned a lot, but something is still unclear to me.
on the one hand, i understand from halb27 & extrabigmehdi that everything i didn't touch (aka everything not faded) will remain the same, which is perfect for me, and extrabigmehdi is right, i don't care about the fact that whatever's been faded cannot be recovered, it's only 1 second of the entire song in most cases.
but then there's this dithering thing that andrew_berge is talking about, i never heard of it, and if it modifies the entire file than even the parts i didn't mess with are becoming different, which is a big problem for me, could you please explain to me what is this dithering thing, and how can i change it so that it won't change the file completely?
oh, and Garf, if you meant a portable player, i don't have one, i'm just listening to the music in my PC.
and if you meant a media playing software like winamp and such, i don't realy like it, since it's only cosmetic.
i also want to make sure that other people who aren't as techy as i am can enjoy these songs (i share them to many people) without having to download any extra software for it.

is fading in/out a lossy process?
Reply #11
I'm not so good at explaining this, so i'll just link you to Audacity's Wiki page on the subject.

And a good quote from there:
Quote
If you have recorded in 16-bit and are only doing simple editing (cut, delete, paste, trim...) and not doing any processing (amplify, equalize, frequency filter....) then for highest accuracy dither can be set to "none". In this case, because there are no 32-bit operations prior to export there is no benefit to using dither. Exporting a 16-bit track to 16-bit with dither set to "none" will be lossless. The same applies if exporting from a 24-bit track to an uncompressed 24-bit file format with dither disabled.


The setting can be changed in the Preferences, under "Quality", as halb27 has already said.


  • halb27
  • [*][*][*][*][*]
is fading in/out a lossy process?
Reply #12
Dithering adds some noise to the least significant bits in the music signal. It is meant to 'smooth' the music after heavy manipulation of the music when simple rounding to 16 bit can have a negative effect.
In Audacity the kind of dithering chosen under 'Preferences' 'Quality' is used when exporting to wav or flac, no matter what you've done before. I just tried: when a dither method is selected Audacity will dither on export thus modifying the original.

So if you use Audacity for fading in or out: switch dithering off.
If you don't use Audacity: don't care about all this stuff.


I see I'm late.
  • Last Edit: 19 February, 2013, 05:33:07 PM by halb27
lame3995o -Q1

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
is fading in/out a lossy process?
Reply #13
oh, and Garf, if you meant a portable player, i don't have one, i'm just listening to the music in my PC.
and if you meant a media playing software like winamp and such, i don't realy like it, since it's only cosmetic.
Winamp is by no means the only media player that can crossfade, and many that can provide countless features beyond “only cosmetic” ones. But if you’d rather spend lots of time manually and irreversibly altering your files when you could instead use a player capable of automatically and non-destructively fading them for you, then OK.

Quote
i also want to make sure that other people who aren't as techy as i am can enjoy these songs (i share them to many people) without having to download any extra software for it.
Oh, you should have said! Definitely upsample your files to 192 kHz and 32-bit floating-point, then encode them with Blade. Happy sharing!

  • yourlord
  • [*][*][*][*]
is fading in/out a lossy process?
Reply #14
i also want to make sure that other people who aren't as techy as i am can enjoy these songs (i share them to many people) without having to download any extra software for it.


Let me just say that this forum is not the place to make such confessions..

And please, if you're going to distribute the files (not something condoned here unless you own the copyright) then leave them unmodified!

  • greynol
  • [*][*][*][*][*]
  • Global Moderator
is fading in/out a lossy process?
Reply #15
I think the world is better off to have them modified per db1989's suggestion.
13 February 2016: The world was blessed with the passing of a truly vile and wretched person.

Your eyes cannot hear.

  • mjb2006
  • [*][*][*][*][*]
is fading in/out a lossy process?
Reply #16
unicorn20, in your original post, you mentioned gap detection. You seem to misunderstand what it is.

The audio on a CD is divided into tracks. Each track is divided into one or more sections called indexes. Usually there's only one section, index 01, which takes up the whole track. Sometimes there's two sections: index 01 for the main song, and before that, a brief section called index 00 (that track's "gap" or "pre-gap"). This is often silence, but might be an interlude, count-in, applause, or other filler. It is what you probably think of as being "between" the tracks, or perhaps at the end, audio-wise, of the previous track. Technically, though, it's the beginning of the current track. But since we always rip or play tracks starting at index 01, it's more natural to think of it as being at the end.

Only index 00 is what we call the "gap". There can also be indexes up to 99, but anything above 01 is uncommon (I think 2 or 3 out of 1000 CDs I own have index 02s) and anything higher than 03 is extremely rare (apparently it's mostly on sound effects CDs that would otherwise need to exceed the 99-track limit).

Now consider what happens when you're using a real CD player, and you reach the end of a song. As the gap/index 00 (if any) at the start of the next track plays, you see the track number go up by 1, and the time display switches to negative numbers, counting up to 0:00, at which point index 01 plays. You don't see this when playing files or even CDs in a computer; the gap is normally just at the end of the previous track's file.

For example, if there's a 5-second gap at the end of a song 3 minutes, 30 seconds long, in a computer you'll just see the counter go 3:29, 3:30, 3:31, 3:32, 3:33, 3:34, 0:00 (track number increments here). On a real CD player you would see 3:29, -0:05 (track number increments here), -0:04, -0:03, -0:02, -0:01, 0:00. The audio would be the same in either case.

Apparently there was some folklore on some excessively bureaucratic file-sharing forums that said to make the ripping software do a gap detection pass before ripping. There's no point to doing so. Ripping software that's capable of gap detection does it automatically when needed. And it's only needed for three situations: 1. when generating accurate cue sheets for discs that have gaps (so you can use the files to burn a CD that behaves as described above in a real CD player); 2. doing an index-based rip, where each index goes into its own file, rather than each complete track going into a file (useful for when you want interludes to be in files separate from the main songs); or 3. deliberately omitting gap audio from a rip, such as when you're ripping from a CD-R that has had silent gaps added in error (but you have to tell the ripper to do this; just detecting gaps doesn't make it omit them).

Gap & other index info isn't always possible or reliable (it's in the "subcode" alongside the audio data, harder to read). It all depends on the software, the drive, and the CD. When gap detection isn't done, the ripper just treats each track as if it only has one section, index 01. No audio is left out.
  • Last Edit: 20 February, 2013, 03:24:10 AM by mjb2006

  • unicorn20
  • [*]
is fading in/out a lossy process?
Reply #17
i'd like to begin by saying ***THANK YOU SO MUCH*** to each and every one of you for helping me and teaching me so many new things i had no idea about, i seriously love this forum and you guys are the best, so honestly... THANK YOU, i appreciate it 

I'm not so good at explaining this, so i'll just link you to Audacity's Wiki page on the subject.

thanks for the info about dithering 

Dithering adds some noise to the least significant bits in the music signal. It is meant to 'smooth' the music after heavy manipulation of the music when simple rounding to 16 bit can have a negative effect.
So if you use Audacity for fading in or out: switch dithering off.

you say rounding to 16bit can have a negative effect, what kind of negative effect?
i switched the dithering thing off, it seems weird to me that audacity will do the dithering by default and not by user request, since the whole point of lossless music is to be the same as the original, and the dithering modifies the file, but who am i to judge.

Oh, you should have said! Definitely upsample your files to 192 kHz and 32-bit floating-point, then encode them with Blade. Happy sharing!

i'm sure it's a nooby question, but why should i upsample? will it benefit the sound quality in any way?
also, i've so far encoded using the latest LAME, is this blade a better encoder? and as i asked above, will it benefit the sound quality in any way?

Let me just say that this forum is not the place to make such confessions..

you're absolutely right, it was a moment of foolishness... 

unicorn20, in your original post, you mentioned gap detection. You seem to misunderstand what it is.

Now consider what happens when you're using a real CD player, and you reach the end of a song. As the gap/index 00 (if any) at the start of the next track plays, you see the track number go up by 1, and the time display switches to negative numbers, counting up to 0:00, at which point index 01 plays. You don't see this when playing files or even CDs in a computer; the gap is normally just at the end of the previous track's file.

For example, if there's a 5-second gap at the end of a song 3 minutes, 30 seconds long, in a computer you'll just see the counter go 3:29, 3:30, 3:31, 3:32, 3:33, 3:34, 0:00 (track number increments here). On a real CD player you would see 3:29, -0:05 (track number increments here), -0:04, -0:03, -0:02, -0:01, 0:00. The audio would be the same in either case.

Gap & other index info isn't always possible or reliable (it's in the "subcode" alongside the audio data, harder to read). It all depends on the software, the drive, and the CD. When gap detection isn't done, the ripper just treats each track as if it only has one section, index 01. No audio is left out.

you're right. i did misunderstand the entire concept of what these gaps are, but you've done a really good job of explaining it.
i haven't used an actual CD player in more than 10 years so i had to dig in my memory a little, but you're right, i do remember the countdown to the next song (-0:05, -0:04...), you just made me do a little time travel in my mind  .
and i never really realized why there is that index 00 in the cue files, but now i do, so thanks, i just got a little smarter.

  • pdq
  • [*][*][*][*][*]
is fading in/out a lossy process?
Reply #18
Oh, you should have said! Definitely upsample your files to 192 kHz and 32-bit floating-point, then encode them with Blade. Happy sharing!

i'm sure it's a nooby question, but why should i upsample? will it benefit the sound quality in any way?
also, i've so far encoded using the latest LAME, is this blade a better encoder? and as i asked above, will it benefit the sound quality in any way?

db1989 should have made it more clear that he was being sarcastic. Blade was an awful encoder, and upsampling and 32-bit floating point have no benefit in this case.

  • unicorn20
  • [*]
is fading in/out a lossy process?
Reply #19
db1989 should have made it more clear that he was being sarcastic. Blade was an awful encoder, and upsampling and 32-bit floating point have no benefit in this case.

i see hehehe, i kinda had a feeling it was something like that, it seemed illogical to me, but since i don't know as much as other respected forum members, i didn't want to argue

  • greynol
  • [*][*][*][*][*]
  • Global Moderator
is fading in/out a lossy process?
Reply #20
db1989 should have made it more clear that he was being sarcastic. Blade was an awful encoder, and upsampling and 32-bit floating point have no benefit in this case.

The benefit was to discourage people from engaging in illegal distribution of copyrighted material.
13 February 2016: The world was blessed with the passing of a truly vile and wretched person.

Your eyes cannot hear.

  • mjb2006
  • [*][*][*][*][*]
is fading in/out a lossy process?
Reply #21
you say rounding to 16bit can have a negative effect, what kind of negative effect?

It adds a small amount of noise that almost certainly isn't audible. It would probably be quite audible if you were reducing to 8-bit. Some people like to add dither when reducing to 16-bit "just in case". It's kind of like the decision to use lossless or maximum-bitrate lossy, even though 99.9999% of the time, lossy encoding with modest settings yields transparency. When dither is used, the dither itself may be audible (like tape hiss), unless you use noise shaping to confine it to the higher frequency ranges. Personally I wouldn't worry about it; just leave the dither off unless you're going below 16-bit. Though I admit, I fall into the "just in case" trap a lot.

it seems weird to me that audacity will do the dithering by default

Audacity is trying to accommodate more kinds of processing and merging of files than just the simple cut/copy/paste and volume-level adjustments that you're doing. However even for more complex processing, as long as you're working at 16-bit or higher, dither is still a "just in case" kind of thing for people who swear their golden ears can hear a difference, despite the failure of blind testing to show that anyone can. (someone correct me if I'm wrong)

The benefit was to discourage people from engaging in illegal distribution of copyrighted material

Encouraging him to share degraded, pointlessly converted material doesn't seem to be a good way to discourage him from doing that. It's just hazing and well-poisoning that you seem to think would be funny. And he didn't actually admit to the material being copyrighted, though it does seem likely.
  • Last Edit: 20 February, 2013, 05:22:07 PM by mjb2006

  • greynol
  • [*][*][*][*][*]
  • Global Moderator
is fading in/out a lossy process?
Reply #22
My point was not necessarily targeted exclusively at those actively engaging in the essentially universal crime of uploading, it is also to discourage people from grabbing files from the "wild" because there is no guarantee that the well isn't poisoned by people who are clueless about how to handle digital audio.  Gods know the internet is chalked-full of them!

Please tell me where I encouraged him to share anything or are you done with your futile attempt at arguing with me?  Please may it be the latter.  I don't really have the time to deal with your misinterpretation of my post, my intentions and what I appear to find funny.

I do not find the use of this forum to aid in criminal behavior funny.  As I have said elsewhere, this forum has lost revenue as a direct result of posts that were not in accordance with the spirit of TOS #9.
  • Last Edit: 20 February, 2013, 06:32:56 PM by greynol
13 February 2016: The world was blessed with the passing of a truly vile and wretched person.

Your eyes cannot hear.

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
is fading in/out a lossy process?
Reply #23
If I make sure to include something like this  in my next post containing sarcasm about processes that a user could easily identify as not being beneficial to quality by spending a minute or two on Google, will it preclude over-the-top allegations such as “hazing and well-poisoning”?

Never mind the fact that, in that specific context, I don’t think I would have been bothered about how long ago the user had registered: regardless of the age of a user’s account, “hazing”, with all its negative connotations and associated tales of woe (and, FWIW, I tick approximately zero of the boxes necessary to be a frat-boy), is a silly exaggeration when used to describe a joke.

I wasn’t picking on someone because s/he was new: I just made a (failed? bad?) joke based upon my reluctance to have Hydrogenaudio provide yet more facilitation to file-sharing. That, in itself, is nothing personal to unicorn20 or an indication that I don’t want the other questions to be answered: it’s just sideways (sidewarez?) commentary on one particular phenomenon and how it tends to intersect with this site. I kept it deadpan as tacit commentary about my opinion of said phenomenon.

So, it was an attempted joke and one that, I would hope, would be obvious as such after a tiny bit of research. So, with that said, here is where I try to make a positive contribution to this discussion: Independent research and scepticism are healthy, and I encourage them, especially when the subject is something about which you are happy to admit to having little knowledge.

However, although I could extend that logic also to cover staff on websites, I don’t want to harm the reputation that Hydrogenaudio has as a reliable source of information, so I apologise for not making it clear that I was joking – not because of hypersensitivity such as the above but because staff are trusted to be equally reliable, and it’s certainly not my place to cast any doubt upon the site in that capacity, regardless of intent.

So, yes, next time I’ll either make it clear that I’m being a grinch, or I’ll just do my deadpanning in a literal way.

  • greynol
  • [*][*][*][*][*]
  • Global Moderator
is fading in/out a lossy process?
Reply #24
You are too kind, db1989.

I stopped aiding people who give the appearance of being up to no good or not taking the time to help themselves.

Just so that I don't come off as a complete trollish asshole (assholish troll, asshole troll?), the answer to the question in the subject line is yes.
  • Last Edit: 20 February, 2013, 07:04:11 PM by greynol
13 February 2016: The world was blessed with the passing of a truly vile and wretched person.

Your eyes cannot hear.