Detecting whether a 24-bit file has been upconverted from 16-bit? |
![]() ![]() |
Detecting whether a 24-bit file has been upconverted from 16-bit? |
Nov 9 2012, 16:01
Post
#26
|
|
![]() Group: Members Posts: 3212 Joined: 29-October 08 From: USA, 48236 Member No.: 61311 |
I downloaded a FLAC album from online web store and it appears that the files I've downloaded are 24-bit. it's not a hd web store like hdtracks, it's generally a CD 16-bit 44.1kHz store with either FLAC or MP3 to choose from in its offerings. I'm wondering whether the 24-bit files are real and were supplied as 24-bit from the label and they just didn't label it correctly on the download page, or whether there was an encoding error or just somehow it made its way from 16-bit files to 24-bit FLACs. Is there a way I can definitively tell or analyze it (looking at spectral maybe) to see if it's been upconverted? Are there certain algorithms and 'good jobs' that can be done to make its 16->24 upconversion undetectable? Many of the actual upconversions are going to be pretty hard to determine by simple means. For example it is pretty well known that about half of all so-called HD tracks started out as analog tapes or non-CD digital recordings that either came from or passed through the analog domain during the transcription process. Catching only the clerical errors and obvious transcription errors is only a partial solution. |
|
|
|
Apr 13 2013, 01:47
Post
#27
|
|
|
Group: Members Posts: 5 Joined: 31-July 12 Member No.: 101901 |
CODE flac -ac foo.flac | findstr wasted_bits (for windows) fbits: CODE #!/bin/bash me="${0##*/}" if [ -w "$TMPDIR" ]; then tdir="$TMPDIR" elif [ -w '/tmp' ]; then tdir='/tmp' elif [ -w "$HOME" ]; then tdir="$HOME" elif [ -w "$PWD" ]; then tdir="$PWD" else echo "$me: error: can't find a writable directory for creating the temporary file" 1>&2 ; exit 1 fi tf="$( TMPDIR="$tdir" mktemp "${tdir}/${me}.XXXX" 2>/dev/null )" if [ -z "$tf" ]; then echo "$me: error: can't create temporary file" 1>&2 ; exit 1 fi checkbits () { local bps abps tbps=0 n=0 bps="$( metaflac --show-bps "$1" )" flac -ac "$1" 2>/dev/null | fgrep 'wasted_bits' | cut -d '=' -f 3 | cut -f 1 > "$tf" while read wb; do tbps=$(( tbps + ( bps - wb ) )) ((n++)) done < "$tf" abps=$(( ( ( tbps * 10 / n) + 5 ) / 10 )) # (* 10 + 5) / 10 for proper rounding printf "%2u/%2u bits\t%s\n" "$abps" "$bps" "$1" } for f in "$@"; do case "$f" in *.flac) checkbits "$f" ;; *) continue ;; esac done rm -f "$tf" Usage: CODE fbits *.flac Can anyone convert that Unix BASH script for Windows BATCH script? I don't want to install anything more, I've got so much installed already. Windows 7 (x64) and Windows XP (x86) user. Using what nu774 provided gives me over 4,000 lines of text. It would be more convenient to have summarized results in a printed text file. Thanks for any help. PS: I've ready looked at a few threads where people were trying, miserably, to install software to use BASH scripts on a Windows environment. Those threads didn't seem entirely successful and were incomplete in instructions. |
|
|
|
Apr 13 2013, 07:41
Post
#28
|
|
![]() Group: Members Posts: 1066 Joined: 4-May 04 From: France Member No.: 13875 |
Maybe Greynol can help?
-------------------- Save my friend from going homeless: http://outpost.fr/url/308w
|
|
|
|
Apr 13 2013, 09:39
Post
#29
|
|
|
Group: Developer (Donating) Posts: 2041 Joined: 19-October 01 From: Finland Member No.: 322 |
Here's a quick Windows .cmd script trying to do the same thing:
fbits.zip ( 601bytes )
Number of downloads: 27 |
|
|
|
Apr 13 2013, 09:59
Post
#30
|
|
|
Group: Members Posts: 5 Joined: 31-July 12 Member No.: 101901 |
Here's a quick Windows .cmd script trying to do the same thing:
fbits.zip ( 601bytes )
Number of downloads: 27Thank you! But it's hard to figure out why it's not working. I've replaced the only isntance of the program call with the filepath of the actual program. It just opens and then closes right away. -------------------- [center]24bit/48kHz/5.1 or bust.[/center]
|
|
|
|
Apr 13 2013, 10:11
Post
#31
|
|
|
Group: Developer (Donating) Posts: 2041 Joined: 19-October 01 From: Finland Member No.: 322 |
It's meant to be used from command prompt when flac.exe and metaflac.exe are in search path. You can add "pause" command as the last line and then you can drag and drop .flac files over it. For drag and drop use it's enough to have flac.exe and metaflac.exe in the same dir as the .cmd file.
This post has been edited by Case: Apr 13 2013, 10:11 |
|
|
|
Apr 13 2013, 10:40
Post
#32
|
|
|
Group: Members Posts: 583 Joined: 12-May 06 From: Colorado, USA Member No.: 30694 |
Thanks for the .cmd version.
I suggest modifying it to use flac -acs rather than flac -ac, so you don't get the copyright/warranty/license header after every file it processes. (Maybe this varies by flac build?) |
|
|
|
Apr 13 2013, 16:12
Post
#33
|
|
![]() Group: Members Posts: 3212 Joined: 29-October 08 From: USA, 48236 Member No.: 61311 |
I downloaded a FLAC album from online web store and it appears that the files I've downloaded are 24-bit. it's not a hd web store like hdtracks, it's generally a CD 16-bit 44.1kHz store with either FLAC or MP3 to choose from in its offerings. I'm wondering whether the 24-bit files are real and were supplied as 24-bit from the label and they just didn't label it correctly on the download page, or whether there was an encoding error or just somehow it made its way from 16-bit files to 24-bit FLACs. Is there a way I can definitively tell or analyze it (looking at spectral maybe) to see if it's been upconverted? Are there certain algorithms and 'good jobs' that can be done to make its 16->24 upconversion undetectable? It all depends on how the file was upconverted. If a schlock job was done, and the file was converted from 16 to 24 by simply padding with zeroes, then that would be detectable by obvious means. If a good job was done with a properly dithered conversion, then I don't know of a reliable numerical test for that. I'd like to see people explain why their code fragments should be reliable, and then demonstrate that their code fragments are reliable detectors of upsampling if the file was upsampled correctly. |
|
|
|
Apr 13 2013, 16:18
Post
#34
|
|
![]() Group: Super Moderator Posts: 9269 Joined: 1-April 04 Member No.: 13167 |
I don't see the point in adding dither when increasing the bit-depth.
-------------------- Everything sounds the same until it is proven otherwise.
|
|
|
|
Apr 13 2013, 17:28
Post
#35
|
|
![]() Group: Members Posts: 1066 Joined: 4-May 04 From: France Member No.: 13875 |
I'd like to see people explain why their code fragments should be reliable, and then demonstrate that their code fragments are reliable detectors of upsampling if the file was upsampled correctly. Is that directed at me? I make no such claim. -------------------- Save my friend from going homeless: http://outpost.fr/url/308w
|
|
|
|
Apr 13 2013, 22:22
Post
#36
|
|
![]() Group: Members Posts: 3212 Joined: 29-October 08 From: USA, 48236 Member No.: 61311 |
|
|
|
|
Apr 14 2013, 01:00
Post
#37
|
|
![]() Group: Members Posts: 145 Joined: 18-May 10 From: Montana, USA Member No.: 80732 |
Anyone know how to adjust Skamp's script to work with wavpack files (hybrid in my case)? Wvunpack -ss doesn't seem to supply the needed information
Thanks -------------------- Music lover and recovering high end audiophile
|
|
|
|
Apr 14 2013, 15:23
Post
#38
|
|
![]() Group: Members Posts: 552 Joined: 22-May 05 From: France Member No.: 22220 |
I don't see the point in adding dither when increasing the bit-depth. Cover up. Keep it from being easy to detect your trickery.To make sure all 8 bits are effected, a tiny bit of DSP (e.g. a level change of -0.01dB) would be more effective IME since dither might not toggle all 8 bits. |
|
|
|
Apr 16 2013, 21:11
Post
#39
|
|
|
Group: Members Posts: 132 Joined: 22-May 04 Member No.: 14241 |
How would this technique rate a file consisting of a single loud piano note every few seconds with some softly spoken voice?
How do different masterings come out, something lower level vs the loud nonoise version? |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 26th May 2013 - 03:49 |