• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

SINAD Measurements

Rja4000

Major Contributor
Forum Donor
Joined
May 31, 2019
Messages
2,767
Likes
4,711
Location
Liège, Belgium
Last edited:

Blumlein 88

Grand Contributor
Forum Donor
Joined
Feb 23, 2016
Messages
20,771
Likes
37,636
Meant to ask before if there is a copy of Amir's multitone file that can be downloaded. You could create your own, but copying is so much easier.
 

solderdude

Grand Contributor
Joined
Jul 21, 2018
Messages
16,054
Likes
36,445
Location
The Neitherlands
Would be fun to test headphones with a multitone as well.
A WAV file would be great.
 

Rja4000

Major Contributor
Forum Donor
Joined
May 31, 2019
Messages
2,767
Likes
4,711
Location
Liège, Belgium
Meant to ask before if there is a copy of Amir's multitone file that can be downloaded. You could create your own, but copying is so much easier.
True
But you'd need a different one for each sampling frequency/FFT window size
Although I guess he's always using the same (which is not the one published here)
 

amirm

Founder/Admin
Staff Member
CFO (Chief Fun Officer)
Joined
Feb 13, 2016
Messages
44,679
Likes
241,148
Location
Seattle Area

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
7,906
Likes
16,732
Location
Monument, CO
You mean to select the frequencies?

Mainly for the phase. I use the IEEE Standard for frequencies, but do not recall it specifying phase. Having the signals "line up" to maximize the amplitude (or crest factor) was routine when I was designing and testing (RF) data converters; I had not considered if a particular phase relationship could be established to reduce the peaks for a given set of tones and record length. Rather the opposite; we intentionally designed test signals to hit all codes possible for a given frequency and record length.
 

scott wurcer

Major Contributor
Audio Luminary
Technical Expert
Joined
Apr 24, 2019
Messages
1,501
Likes
2,822
Last edited:

Rja4000

Major Contributor
Forum Donor
Joined
May 31, 2019
Messages
2,767
Likes
4,711
Location
Liège, Belgium
The frequency is easy.
Using Excel formula, if A1 is Sampling rate, A2 is FFT Window size and A3 is your target frequency, the formula is
=ROUND(A3/A1*A2;0)*A1/A2
As an example:
if Sampling rate = 192000, FFT Window size= 65536 and target frequency is 1000Hz,
the selected frequency is ROUND(1000/192000*65536;0)*192000/65536 = 999.023438 Hz

The Phase, I don't know (yet), and I'm interested too... :)
 

KSTR

Major Contributor
Joined
Sep 6, 2018
Messages
2,788
Likes
6,231
Location
Berlin, Germany
I'd be interested in the algorithm to generate the tones.
Find attached a quick&dirty very-much-work-in-progress C code that I use for generating a specific multitone sequence. It's literally a set of cosine oscillators.
The bin population was "stolen" (reverse-engineered from one of REW's "NID" multitone sequences with all the IMD components being (multiples of) 7 bins apart (so that they can be discerned from the noise).

Generates a 64bit floating-point ultra-high precision output array (pure to way below -200dB), which can be converted to whatever WAV format with the SoX utility (if Sox says 'clipping' then reduce the scale factor).
Compiles with MinGW, a mimimalist compiler for Windows (no GUI). Edit the file to your needs (like setting specific phases and amplitudes, atm the phase is random -- specific phase tailoring to get defined crest factors could be inserted here -- , FFT-size to be used is 16k, only a single block is created, scale factor is unity with all phases set to 0, etc), I didn't bother to write an options interface or setup file read-in.
The combination of sample-rate applied to the output and the block size determines the component frequencies and the frequency headroom for the upper products.
Don't populate bins at and above FFTsize/2 ;-)
gcc -march=native -Os -s -Wall GenMTone_7.c -o GenMTone_7.exe
 

Attachments

  • GenMTone_7.c.txt
    2.4 KB · Views: 133

scott wurcer

Major Contributor
Audio Luminary
Technical Expert
Joined
Apr 24, 2019
Messages
1,501
Likes
2,822
The frequency is easy.
Using Excel formula, if A1 is Sampling rate, A2 is FFT Window size and A3 is your target frequency, the formula is
=ROUND(A3/A1*A2;0)*A1/A2
As an example:
if Sampling rate = 192000, FFT Window size= 65536 and target frequency is 1000Hz,
the selected frequency is ROUND(1000/192000*65536;0)*192000/65536 = 999.023438 Hz

The Phase, I don't know (yet), and I'm interested too... :)

If you simply want 30 tones spaced at 1/3 octaves (with 1000Hz included as closely as possible) this works.

sample_rate = 192000.
fft_len = 65536.

base = sample_rate/fft_len

for n in range(-16,14):
freq = round((1000*pow(2.0,n/3.0)/base))*base

Which gives...

23.4375
32.2265625
38.0859375
49.8046875
61.5234375
79.1015625
99.609375
125.9765625
158.203125
199.21875
249.0234375
316.40625
395.5078125
500.9765625
629.8828125
793.9453125
999.0234375
1259.765625
1587.890625
2000.9765625
2519.53125
3175.78125
3999.0234375
5039.0625
6348.6328125
8000.9765625
10078.125
12700.1953125
15999.0234375
20159.1796875
 
Top Bottom