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 6 2012, 05:50
Post
#1
|
|
|
Group: Members Posts: 37 Joined: 23-August 09 Member No.: 72571 |
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? happy to upload a sample if it helps. thanks vince |
|
|
|
![]() |
Nov 6 2012, 06:31
Post
#2
|
|
![]() Group: Developer Posts: 295 Joined: 22-November 10 From: Japan Member No.: 85902 |
Try something like the following to see if wasted bits is equal to or greater than 8 for each FLAC sub-frames.
CODE flac -ac foo.flac | findstr wasted_bits (for windows) flac -ac foo.flac | grep wasted_bits (for Unix like OS) |
|
|
|
Nov 6 2012, 12:06
Post
#3
|
|
![]() Group: Members Posts: 1063 Joined: 4-May 04 From: France Member No.: 13875 |
Try something like the following to see if wasted bits is equal to or greater than 8 for each FLAC sub-frames. Thanks! I used your idea to make a BASH script that prints out the average number of effective bits of FLAC files. 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 Output with a lossyFLAC album (Daft Punk - Homework): CODE 12/16 bits 01. Daftendirekt.lossy.flac 11/16 bits 02. WDPK 83.7 FM.lossy.flac 11/16 bits 03. Revolution 909.lossy.flac 10/16 bits 04. Da Funk.lossy.flac 11/16 bits 05. Phœnix.lossy.flac 10/16 bits 06. Fresh.lossy.flac 11/16 bits 07. Around the World.lossy.flac 10/16 bits 08. Rollin' & Scratchin'.lossy.flac 11/16 bits 09. Teachers.lossy.flac 10/16 bits 10. High Fidelity.lossy.flac 10/16 bits 11. Rock'n Roll.lossy.flac 12/16 bits 12. Oh Yeah.lossy.flac 11/16 bits 13. Burnin'.lossy.flac 10/16 bits 14. Indo Silver Club.lossy.flac 10/16 bits 15. Alive.lossy.flac 11/16 bits 16. Funk Ad.lossy.flac Output with a "true" 24 bit album (The Beatles - Love): CODE 23/24 bits 01. Because.flac 22/24 bits 02. Get Back.flac 22/24 bits 03. Glass Onion.flac 23/24 bits 04. Eleanor Rigby ∕ Julia (transition).flac 22/24 bits 05. I Am the Walrus.flac 21/24 bits 06. I Want to Hold Your Hand.flac 22/24 bits 07. Drive My Car ∕ The World ∕ What You're Doing.flac 23/24 bits 08. Gnik Nus.flac 22/24 bits 09. Something ∕ Blue Jay Way (transition).flac 22/24 bits 10. Being for the Benefit of Mr. Kite ∕ I Want You (She's So Heavy) ∕ Helter Skelter.flac 21/24 bits 11. Help.flac 22/24 bits 12. Blackbird ∕ Yesterday.flac 22/24 bits 13. Strawberry Fields Forever.flac 22/24 bits 14. Within You Without You ∕ Tomorrow Never Knows.flac 22/24 bits 15. Lucy in the Sky With Diamonds.flac 22/24 bits 16. Octopus's Garden.flac 22/24 bits 17. Lady Madonna.flac 22/24 bits 18. Here Comes the Sun ∕ The Inner Light (transition).flac 22/24 bits 19. Come Together ∕ Dear Prudence ∕ Cry Baby Cry (transition).flac 22/24 bits 20. Revolution.flac 22/24 bits 21. Back in the U.S.S.R..flac 23/24 bits 22. While My Guitar Gently Weeps.flac 22/24 bits 23. A Day in the Life.flac 22/24 bits 24. Hey Jude.flac 22/24 bits 25. Sgt. Pepper's Lonely Hearts Club Band (reprise).flac 22/24 bits 26. All You Need Is Love.flac Output with a 16 bit album, upsampled to 24 bits (Daft Punk - Homework): CODE 16/24 bits 01. Daftendirekt.flac
16/24 bits 02. WDPK 83.7 FM.flac 16/24 bits 03. Revolution 909.flac 16/24 bits 04. Da Funk.flac 16/24 bits 05. Phœnix.flac 16/24 bits 06. Fresh.flac 16/24 bits 07. Around the World.flac 16/24 bits 08. Rollin' & Scratchin'.flac 16/24 bits 09. Teachers.flac 16/24 bits 10. High Fidelity.flac 16/24 bits 11. Rock'n Roll.flac 16/24 bits 12. Oh Yeah.flac 16/24 bits 13. Burnin'.flac 16/24 bits 14. Indo Silver Club.flac 16/24 bits 15. Alive.flac 16/24 bits 16. Funk Ad.flac -------------------- Save my friend from going homeless: http://outpost.fr/url/308w
|
|
|
|
Nov 8 2012, 16:33
Post
#4
|
|
|
Group: Members Posts: 97 Joined: 14-January 12 Member No.: 96426 |
I used your idea to make a BASH script that prints out the average number of effective bits of FLAC files. Many thanks! Ran it on my collection of 20,000 tracks, and only found 6 albums showing significant "unused" bits. One, a pure spoken voice one (language training record) had "effective" bits between 13 and 15 depending on the track, 2 CD's (Smoke & Strong Whiskey by Christy Moore and In My Memory by Dj Tiësto) had consistent 15 bits out of 16, and 2 supposedly 24 bit downloads (A Retrospective by The Unthanks and the LSO Haitink Beethoven Symphony no. 9, both from B&W Society of Sound) had consistent 16 effective bits. The one strange one was Portico Quartet from B&W Society of Sound: 22/24 bits Portico Quartet/Portico Quartet/10 Trace.flac 23/24 bits Portico Quartet/Portico Quartet/01 Window Seat.flac 16/24 bits Portico Quartet/Portico Quartet/02 Ruins.flac 16/24 bits Portico Quartet/Portico Quartet/03 Spinner.flac 23/24 bits Portico Quartet/Portico Quartet/06 Laker Boo.flac 19/24 bits Portico Quartet/Portico Quartet/05 Export to Hot Climes.flac 16/24 bits Portico Quartet/Portico Quartet/09 City of Glass.flac 20/24 bits Portico Quartet/Portico Quartet/08 4096 Colours.flac 22/24 bits Portico Quartet/Portico Quartet/07 Steepless.flac |
|
|
|
vincefalks Detecting whether a 24-bit file has been upconverted from 16-bit? Nov 6 2012, 05:50
Sparktank QUOTE (nu774 @ Nov 6 2012, 06:31) CODEfla... Apr 13 2013, 01:47
bandpass QUOTE (vincefalks @ Nov 6 2012, 04:50) Ar... Nov 6 2012, 09:11
spoon >Are there certain algorithms and 'good job... Nov 6 2012, 11:47
nu774 BTW, I think just a slight gain scaling from the o... Nov 6 2012, 12:31
greynol You can add noise or simply use Audacity which can... Nov 6 2012, 12:42
2Bdecided There's no way of knowing for sure. Unlike low... Nov 6 2012, 12:45
vincefalks Thanks guys (and yeah thanks greynol for pointing ... Nov 6 2012, 16:29
skamp QUOTE (vincefalks @ Nov 6 2012, 16:29) Th... Nov 6 2012, 17:40
vincefalks QUOTE (skamp @ Nov 6 2012, 17:40) QUOTE (... Nov 6 2012, 18:44

skamp QUOTE (vincefalks @ Nov 6 2012, 18:44) it... Nov 6 2012, 18:58

Porcus QUOTE (vincefalks @ Nov 6 2012, 19:44) it... Nov 8 2012, 17:33
Destroid Interesting discussion. I hope the market does not... Nov 6 2012, 23:21
Porcus QUOTE (Destroid @ Nov 7 2012, 00:21) I ho... Nov 8 2012, 17:38
greynol Don't blame flac.exe. It will not take 16-bit... Nov 6 2012, 17:23
vincefalks QUOTE (greynol @ Nov 6 2012, 17:23) Don... Nov 6 2012, 17:47
greynol 6dB of gain was applied to the master with no furt... Nov 6 2012, 17:42
greynol You would really have to go out of your way to do ... Nov 6 2012, 17:59
2Bdecided An even smarter analysis can figure out which 24-b... Nov 8 2012, 17:16
pdq Let's not forget that a file that was up-conve... Nov 8 2012, 18:27
2Bdecided QUOTE (pdq @ Nov 8 2012, 18:27) Let's... Nov 9 2012, 10:33
julf QUOTE (pdq @ Nov 8 2012, 18:27) Let's... Nov 9 2012, 13:39
pdq ...and it makes sense that if the tracks had been ... Nov 9 2012, 15:11
Arnold B. Krueger QUOTE (vincefalks @ Nov 5 2012, 23:50) I ... Nov 9 2012, 16:01
skamp Maybe Greynol can help? Apr 13 2013, 07:41
Case Here's a quick Windows .cmd script trying to d... Apr 13 2013, 09:39
Sparktank QUOTE (Case @ Apr 13 2013, 01:39) Here... Apr 13 2013, 09:59
Case It's meant to be used from command prompt when... Apr 13 2013, 10:11
mjb2006 Thanks for the .cmd version.
I suggest modifying ... Apr 13 2013, 10:40
Arnold B. Krueger QUOTE (vincefalks @ Nov 6 2012, 00:50) I ... Apr 13 2013, 16:12
skamp QUOTE (Arnold B. Krueger @ Apr 13 2013, 17... Apr 13 2013, 17:28
greynol I don't see the point in adding dither when in... Apr 13 2013, 16:18
Arnold B. Krueger QUOTE (greynol @ Apr 13 2013, 11:18) I do... Apr 13 2013, 22:22
Kees de Visser QUOTE (Arnold B. Krueger @ Apr 13 2013, 22... Apr 14 2013, 15:23
BearcatSandor Anyone know how to adjust Skamp's script to wo... Apr 14 2013, 01:00
MikeFord How would this technique rate a file consisting of... Apr 16 2013, 21:11![]() ![]() |
|
Lo-Fi Version | Time is now: 24th May 2013 - 04:49 |