Taperssection.com

Gear / Technical Help => Ask The Tapers => Topic started by: voltronic on January 02, 2015, 10:15:51 AM

Title: Vertically Mirrored Spectrogram - what causes this?
Post by: voltronic on January 02, 2015, 10:15:51 AM
I was looking at the spectrogram view of some files posted to a mic shootout over on GS, and two of the files show something I've seen before on a couple files but I could never figure out the cause.  Basically it looks like there is a vertical mirror image of the entire spectrum of the file centered around 22kHz. 

I asked the person who recorded and posted the files, and he assured me the recording chain was the same for both sets of mics.  I don't think his explanation of what I'm seeing makes sense at all - there's something in the digital realm that must be causing this.  Does anyone know what's going on here?  It's interesting that this is showing up for both Line Audio mics his comparison, but not in either of the Schoeps files.  I own the CM3 and this behavior does not show up in any recordings I have made.

Here's the spectrograms I made in Audacity - see files 1a and 1b:
https://imgur.com/a/TmVzo (https://imgur.com/a/TmVzo)

And here are the source files if you want to analyze yourself, and you'll see my back and forth with the poster below.  Disregard the "download all zipped" - that zip actually contains different files that user previously posted.
https://www.gearslutz.com/board/remote-possibilities-acoustic-music-location-recording/644759-cm3-really-good-37.html#post10682686 (https://www.gearslutz.com/board/remote-possibilities-acoustic-music-location-recording/644759-cm3-really-good-37.html#post10682686)
Title: Re: Vertically Mirrored Spectrogram - what causes this?
Post by: Gene Poole on January 02, 2015, 01:37:46 PM
That is definitely interesting.  You can see it in the waveform as well.  It's like every sample is duplicated so that you get a stair-stepping every 2 samples.

I'd guess that there was some sort of clock issue with the ADC.

(http://hoxnet.com/drop/Screenshot%20from%202015-01-02%2012:32:09.png)
Title: Re: Vertically Mirrored Spectrogram - what causes this?
Post by: Gene Poole on January 02, 2015, 03:43:58 PM
For shits and giggles (and because I'm bored) I wrote a little C program to do what I expect is happening above.  I dug up a 24/96 recording I made recently and took a chunk, dithered it to 24/48, then fed it into my program.  It basically reads the wav header, modifies it to 24/96 and double the length, then writes each sample twice to the new file.  The result is a 96 khz wav file that is really just the 48khz file with each sample duplicated.  Here's the code (I didn't bother with comments):
Code: [Select]

#include <stdio.h>

int main(void)
{
  int i;
  int *rate;
  int *len;
  unsigned char header[44];
  FILE *f_in,*f_out;
  typedef struct t_sample{
    int right:24;
    int left:24;
  }sample;

  sample samp;
  rate=(int *)&header[24];
  len=(int *)&header[40];
  f_in=fopen("02_roper.wav","r");
  f_out=fopen("02_roper_doubled_up.wav","w");

  fread(header,1,44,f_in);

  *rate=96000;
  *len*=2;

  fwrite(header,1,44,f_out);

  while(fread((unsigned char *)&samp,1,6,f_in)){
    fwrite(&samp,1,6,f_out);
    fwrite(&samp,1,6,f_out);
  }

  fclose(f_in);
  fclose(f_out);
  return 0;
}

The results were exactly what I expected; a perfect mirror image of the spectrogram:

(http://hoxnet.com/drop/Screenshot%20from%202015-01-02%2014:33:05.png)
Title: Re: Vertically Mirrored Spectrogram - what causes this?
Post by: voltronic on January 02, 2015, 04:26:07 PM
Wow, that's nice work!  Now I remember where I've seen this before:  There was a dust-up a couple years ago on another board about HDTracks selling files that weren't exactly as advertised - they were selling some albums as 24bit/88.2kHz, and when you looked at the spectrograms they looked similar to what we're talking about here.  It turns out they were 44.1kHz files that were padded to 88.2kHz.

I hope you don't mind, I shared your results over on GS with the person who recorded this.  Thanks so much for helping to clear that up!
Title: Re: Vertically Mirrored Spectrogram - what causes this?
Post by: bombdiggity on January 02, 2015, 05:02:49 PM
That is/was odd.  If they were exact mirror images they'd be inverted from each other (which can result from erroneous cabling/connections or, rarely, improper placement).  They're not exactly inverted though (physical inversion would result in exact opposites).  Inversion is fairly simple to fix in post at least.  These look like they'd sound a lot better if you flipped one channel to get them in phase with each other. 
Title: Re: Vertically Mirrored Spectrogram - what causes this?
Post by: Gene Poole on January 02, 2015, 05:04:57 PM
Wow, that's nice work!  Now I remember where I've seen this before:  There was a dust-up a couple years ago on another board about HDTracks selling files that weren't exactly as advertised - they were selling some albums as 24bit/88.2kHz, and when you looked at the spectrograms they looked similar to what we're talking about here.  It turns out they were 44.1kHz files that were padded to 88.2kHz.

I hope you don't mind, I shared your results over on GS with the person who recorded this.  Thanks so much for helping to clear that up!

My simulation takes it to the extreme: exactly doubling every sample.  the original is not this extreme.  I suspect a clock issue with the ADC used to sample the audio.  Either some really bad jitter, or a some sort of harmonic interfering with the clock.
Title: Re: Vertically Mirrored Spectrogram - what causes this?
Post by: Gene Poole on January 02, 2015, 05:09:19 PM
That is/was odd.  If they were exact mirror images they'd be inverted from each other (which can result from erroneous cabling/connections or, rarely, improper placement).  They're not exactly inverted though (physical inversion would result in exact opposites).  Inversion is fairly simple to fix in post at least.  These look like they'd sound a lot better if you flipped one channel to get them in phase with each other.

I think you're misreading the spectrogram.  The mirror image is not a signal inversion, but a harmonic spike in the frequency caused by the abrupt jump in sample value every other sample.
Title: Re: Vertically Mirrored Spectrogram - what causes this?
Post by: voltronic on January 02, 2015, 05:28:21 PM
Wow, that's nice work!  Now I remember where I've seen this before:  There was a dust-up a couple years ago on another board about HDTracks selling files that weren't exactly as advertised - they were selling some albums as 24bit/88.2kHz, and when you looked at the spectrograms they looked similar to what we're talking about here.  It turns out they were 44.1kHz files that were padded to 88.2kHz.

I hope you don't mind, I shared your results over on GS with the person who recorded this.  Thanks so much for helping to clear that up!

My simulation takes it to the extreme: exactly doubling every sample.  the original is not this extreme.  I suspect a clock issue with the ADC used to sample the audio.  Either some really bad jitter, or a some sort of harmonic interfering with the clock.

OK, that clarifies things a bit.
Title: Re: Vertically Mirrored Spectrogram - what causes this?
Post by: Gene Poole on January 03, 2015, 01:17:10 PM
Oh, and downsampling should not be referred to as dither, which is an entirely different process that addresses a different issue.  Dither involves randomizing the least significant bit when reducing bit depth in order to avoid quantization distortion, whereas downsampling is simply a filtering process.

I knew that.  I don't know why I posted "dithered".  Brain fart I guess.
Title: Re: Vertically Mirrored Spectrogram - what causes this?
Post by: voltronic on January 03, 2015, 01:49:07 PM
How that happened to the guy's recording I have no idea, unless he did indeed use a crappy upsampling process to create the comparison file.  That would invalidate the comparison for several reasons:  first, that means he was using different converters at different sample rates (or some other bizarre method); second, given the amount of ultrasonic noise in the Line sample, if the listener's equipment decides to attempt to pass that ultrasonic band through to the speakers, the playback system could experience significant audio band distortion as a result.  At a minimum, you should downsample both to 48kHz to eliminate the latter problem.

He claimed everything was the same for both sets of mics:  Forssell SMP-2 and Forssell MADA-2.  I think I offended him when I pointed out there may be something wrong with the 2 Line Audio recordings...