Jitter Test Signal (J-test Signal) with MATLAB - diyAudio
Go Back   Home > Forums > Source & Line > Digital Source

Digital Source Digital Players and Recorders: CD , SACD , Tape, Memory Card, etc.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 13th February 2011, 10:28 PM   #1
diyAudio Member
 
Join Date: Feb 2011
Default Jitter Test Signal (J-test Signal) with MATLAB

Iíd very much like to have an audio file based on Julian Dunnís exact description for jitter testing (http://www.nanophon.com/audio/diagnose.pdf). As far as I know this file isnít available for downloading. Iíve come to understand that such a signal would be possible to create with a program like MATLAB. However after some intense browsing a came to the conclusion that the scripting is beyond me. Iíve copied the original explanation from Dunnís paper below. Maybe somebody is willing to figure it out.

Kind regards,

Merlijn

Quote:
A test signal has been developed in order to stimulate worst-case levels of data-jitter. This signal has
two components. The first is an un-dithered square wave with a period of 4 samples. A cycle of this
is shown here in hexadecimal notation (hex):

C00000 C00000 400000 400000

On conversion to analogue at a sample rate of 48kHz this signal would produce a sine wave with an
amplitude of -3.01dBFS at 12kHz.

This is added to an undithered 24 bit square wave of amplitude 1 least significant bit (1 LSB) and dc
offset of -1/2 an LSB. This square wave is repeated at low frequency. In the case of the signal used
in these tests a rate of 250Hz was selected. This adds an undithered square wave of amplitude -
144dBFS and a negative dc offset of -150dBFS. The two values used for this square wave are 0 and
-1 (FFFFFF).

The combination of these signals results in the following 192 sample cycle of 24-bit data values:

C00000 C00000 400000 400000 (x 24) BFFFFF BFFFFF 3FFFFF 3FFFFF (x 24)

The low frequency coherent alternation in the values of the 22 LSBs produces strong jitter spectral
components at the repetition rate and its odd harmonics. A low frequency was used to stimulate jitter
at a frequency that will not be attenuated significantly by a receiver clock recovery circuit. The high
frequency component was selected for convenience when making jitter measurements of DACs; this
is discussed in a later section.
  Reply With Quote
Old 13th February 2011, 10:49 PM   #2
Banned
 
Join Date: Jan 2008
Blog Entries: 2
What do you want it as? A .wav file? Of what duration?

I haven't written a file from code probably since I wrote C under DOS, so it'll probably not arrive until tomorrow, unless somebody can write it off the top of their head.

w
  Reply With Quote
Old 14th February 2011, 02:24 AM   #3
Banned
 
Join Date: Jan 2008
Blog Entries: 2
OK, here's a zip file (down at the bottom), it contains a file called jitter.exe. If you run it it will ask you to press a key to start, it takes a while to run, then it'll ask you to press a key again to indicate that it's done.

It'll create a file in the same directory, jitter.wav, of 17,280,044 bytes, the .wav header and one minute of stereo sound @ 48ksamples, 24 bit resolution.

I've looked at the file with a hex editor, it looks OK to me, there's a mixture of Big- and Little-endian data in there, God knows what Microsoft were up to.

Here's the code, it compiles under Microsoft QC25, if there are any problems you can look and see if you can see any errors, I haven't attempted to debug the output in any way apart from look at it in the hex editor, I haven't tried to run it.


/*******************************************\
* jitter.c *
* 14/02/2011 *
* wakibaki *
\*******************************************/

#include <stdio.h>
#include <io.h>
#include <fcntl.h>
#include <ctype.h>

void main();

void main()
{
FILE *fp;
long length, fileptr;
unsigned char d;
int i;

printf("\jitter\n\n");
printf("Press a key to continue...\n");
getch();
length=15000;
if((fp=fopen("jitter.wav","wb"))!=NULL){
d='R'; /* Chunk ID*/
fputc(d,fp);
d='I';
fputc(d,fp);
d='F';
fputc(d,fp);
d='F';
fputc(d,fp);
d=0x24; /* Chunk Size, 36+No of samples */
fputc(d,fp);
d=0xAC;
fputc(d,fp);
d=0x07;
fputc(d,fp);
d=0x01;
fputc(d,fp);
d='W'; /* Format */
fputc(d,fp);
d='A';
fputc(d,fp);
d='V';
fputc(d,fp);
d='E';
fputc(d,fp);
d='f'; /* SubChunk 1 ID*/
fputc(d,fp);
d='m';
fputc(d,fp);
d='t';
fputc(d,fp);
d=' ';
fputc(d,fp);
d=0x10; /* SubChunk 1 size */
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0x01; /* Audio Format*/
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0x02; /* MumChannels */
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0x80; /* Sample rate */
fputc(d,fp);
d=0xBB;
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0x00; /* Byte rate */
fputc(d,fp);
d=0x65;
fputc(d,fp);
d=0x04;
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0x06; /* Block Align */
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0x18; /* Bits Per Sample */
fputc(d,fp);
d=0x00;
fputc(d,fp);
d='d'; /* SubChunk2 ID */
fputc(d,fp);
d='a';
fputc(d,fp);
d='t';
fputc(d,fp);
d='a';
fputc(d,fp);
d=0x00; /* SubChunk2 Size */
fputc(d,fp);
d=0xAC;
fputc(d,fp);
d=0x07;
fputc(d,fp);
d=0x01;
fputc(d,fp);
for(fileptr=0;fileptr<length;fileptr++){
for(i=0;i<24;i++){
d=0x00; /* Data - Little Endian */
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0xC0;
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0xC0;
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0xC0;
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0xC0;
fputc(d,fp);

d=0x00;
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0x40;
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0x40;
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0x40;
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0x00;
fputc(d,fp);
d=0x40;
fputc(d,fp);
}
for(i=0;i<24;i++){
d=0xFF;
fputc(d,fp);
d=0xFF;
fputc(d,fp);
d=0xBF;
fputc(d,fp);
d=0xFF;
fputc(d,fp);
d=0xFF;
fputc(d,fp);
d=0xBF;
fputc(d,fp);
d=0xFF;
fputc(d,fp);
d=0xFF;
fputc(d,fp);
d=0xBF;
fputc(d,fp);
d=0xFF;
fputc(d,fp);
d=0xFF;
fputc(d,fp);
d=0xBF;
fputc(d,fp);

d=0xFF;
fputc(d,fp);
d=0xFF;
fputc(d,fp);
d=0x3F;
fputc(d,fp);
d=0xFF;
fputc(d,fp);
d=0xFF;
fputc(d,fp);
d=0x3F;
fputc(d,fp);
d=0xFF;
fputc(d,fp);
d=0xFF;
fputc(d,fp);
d=0x3F;
fputc(d,fp);
d=0xFF;
fputc(d,fp);
d=0xFF;
fputc(d,fp);
d=0x3F;
fputc(d,fp);
}
}
fclose(fp);
}
else{
printf("\nError opening files...\n");
exit(1);
}
printf("\jitter\n\n");
printf("Press a key to continue...\n");
getch();
exit(0);
}

w
Attached Files
File Type: zip jitter.zip (6.1 KB, 97 views)
  Reply With Quote
Old 14th February 2011, 02:48 AM   #4
Pano is offline Pano  United States
diyAudio Moderator
 
Pano's Avatar
 
Join Date: Oct 2004
Location: Milliways
Blog Entries: 4
It seems to work. Here is an FFT. I had to convert it to 16 bits, but you get the idea.
Attached Images
File Type: png waki-jitter.png (4.3 KB, 461 views)
File Type: png waki-jitter zoom.png (5.5 KB, 444 views)
__________________
Take the Speaker Voltage Test!
  Reply With Quote
Old 14th February 2011, 09:00 AM   #5
diyAudio Member
 
Join Date: Feb 2011
Great!

Thank you very much for the effort. It seems to work at my pc as well. I think I understand what youíve done. I will be using the file hopefully to test the DACís of a Dolby Lake Processor. Iím curious to the differences between itís PLL and ASRC.

Regards,

Merlijn
  Reply With Quote
Old 14th February 2011, 01:21 PM   #6
diyAudio Member
 
Join Date: Feb 2011
On second thought, would it be possible to also create a 16 bit 44.1 kHz version using the same method. Iíve come to understand that the following parameters (https://ccrma.stanford.edu/courses/4...cts/WaveFormat) need to be changed:


  • ChunkSize (10584036 or A17FE4 HEX)
  • SampleRate (44.1 kHz or AC44 HEX)
  • ByteRate (176400 or 2B110 HEX)
  • BlockAlign (4 or 4 HEX)
  • BitsPerSample (16 or 10 HEX)
  • Subchunk2Size (10584000 or A17FC0 HEX)
  • Data (C000 C000 4000 4000 (x 24) BFFF BFFF 3FFF 3FFF (x24) at 192 sample cycle*)

*This cycle rate or number of samples should stay unaltered to maintain the 4/1000 and 1/4 sample rate frequency ratio.

Kind regards,

Merlijn
  Reply With Quote
Old 14th February 2011, 02:52 PM   #7
diyAudio Member
 
Join Date: Jan 2008
Location: Virginia
Quote:
Originally Posted by Pano View Post
It seems to work. Here is an FFT. I had to convert it to 16 bits, but you get the idea.
The added fake "jitter" was at the LSB in a 24 bit signal. I don't know how did you convert THAT to 16 bit...
  Reply With Quote
Old 14th February 2011, 03:13 PM   #8
diyAudio Member
 
Join Date: Feb 2011
And yet this way of working produces bit accurate results that comply with Dunnís original paper. Iíve downloaded at least one version of the 16 bit test signal claimed to be the ďoneĒ. But closer inspection using a hex editor shows small imperfections. I for one hope that this method can be used to create a 16 bit version.

Regards,

Merlijn
  Reply With Quote
Old 14th February 2011, 04:40 PM   #9
diyAudio Member
 
Join Date: Jan 2008
Location: Virginia
I don't think it can be done. The whole ideea is based on using a "smaller" 24bit step to simulate the jitter of the "bigger" 16bit signal. You need to feed that 24 bit as a 16 bit signal to the receiver to be perceived as jitter.
If you have the same 16 bit for both, you will end up with just regular signal, and that will NOT be seen as jitter by the receiver.
  Reply With Quote
Old 14th February 2011, 07:18 PM   #10
Pano is offline Pano  United States
diyAudio Moderator
 
Pano's Avatar
 
Join Date: Oct 2004
Location: Milliways
Blog Entries: 4
Quote:
Originally Posted by SoNic_real_one View Post
The added fake "jitter" was at the LSB in a 24 bit signal. I don't know how did you convert THAT to 16 bit...
I had to convert to 16 bit to read it in my FFT sotware, as it did not like the 24 bit version. Does not mean you have to use it that way.
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
generate jitter test signal and measurign jitter using AP2? BJAMR Digital Source 11 1st November 2010 02:07 PM
FM test signal to indicate PIM? PMA Solid State 1 17th February 2010 11:07 AM
Intermodulation test signal BitPoint Digital Line Level 5 6th April 2009 11:06 AM
Jitter test signal - 11025+229.6875hz. How to ? percy Digital Source 5 25th April 2007 12:13 AM
Best Digital (bit perfect) Test Signal? drewm1980 Digital Source 3 23rd May 2005 12:09 AM


New To Site? Need Help?

All times are GMT. The time now is 12:40 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright ©1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2