advertisement


Wow and flutter 'meter', etc

I'll update tomorrow. Need to look into veusz, I've used GNUPlot for various purposes like this over the years, but always worth looking around.
 
I usually use a plotting program called "!Tau" on RISC OS, or use the "!DrawGen" system I wrote when some flexibility is needed. That gives me a 'C' library of vector/object primatives from which to generate graphics. Hence my tendency to neglect Veusz at times. If you're familiar with Python (I'm not) you should find the syntax of Veusz easy to twig, and the files are essentially plain text, so then easy to read and tweak. I tend to load a basic plot into Veusz, tweak it slightly, then save the result and look at it with a text editor. That quickly lets me suss how to write what's needed as program output.

Problem is, my Linux apps often aren't really finished as I stop once they do what I wanted. :-/ e.g. being that the W&F code doesn't check that the input file is long enough to be OK. It assumes the file is stereo, has the plain 44byte header, and is long enough for you to get a 10 sec chunk to obtain reliable stats. Get that wrong and it borks rather than warns. Keep meaning to fix it, but have other things on my mind.

I'm impressed by Veusz, but I wish someone would write a good 'how to' book on it with loads of examples.
The Veusz website does have example files to read, though. I worked out the polar plots by looking at the example and playing with it as above, reading what changed did to the saves file contents.
 
Jim's latest including the source file I (very) mildly modified* is at,

http://www.epicyclism.com/audio/WinWF2.zip

It seems to produce plausible output given the GL58 file linked on the previous page.

*A pre-processor define to suppress the MS warnings about insecure printf/sprintf, clearing up the use of strrchr, but only a bit, creating tolerance of both sorts of path separators, and replacing the long term literals "rd" and "wd" in file open modes with the appropriate "rb" and "wb". This code compiles on both Windows and Linux and produces identical output apart from the line endings. FWIW gcc is very grumpy about potentially out of bounds printf, sprintf usages which would be worth paying attention to because it will catch you out one day and this is the main reason C is 'problematic' in the wild.
 
Thanks, Paul. Sorry that I persistently seem to make the same bloopers like the "d". Partly my memory, partly because I adapt previous progs when writing news ones, and duly import old mistakes!

The point about printf family is new to me, and the gcc I use doesn't warn me that I've noticed. But that may mean I didn't recognise when it does! :-/

Shows that I've never taken any courses on computer programming at all, just hack and see.
 
It just seems to crash under Windows 7. Last message is "now doing spectrum of variations - please wait"

Input file a stereo version of the gl58
 
Jim's latest including the source file I (very) mildly modified* is at,

http://www.epicyclism.com/audio/WinWF2.zip

It seems to produce plausible output given the GL58 file linked on the previous page.

*A pre-processor define to suppress the MS warnings about insecure printf/sprintf, clearing up the use of strrchr, but only a bit, creating tolerance of both sorts of path separators, and replacing the long term literals "rd" and "wd" in file open modes with the appropriate "rb" and "wb". This code compiles on both Windows and Linux and produces identical output apart from the line endings. FWIW gcc is very grumpy about potentially out of bounds printf, sprintf usages which would be worth paying attention to because it will catch you out one day and this is the main reason C is 'problematic' in the wild.


Paul

i get the crashing too under Win10. It opens a terminal window and closes it again almost immediately

sorry to be a pita
 
Not looked to see if Paul fixed this, but note that my version requires:

1) The file must be stereo *and* longer than 10 seconds. (How much longer depends on the start time you give it.)

2) header must be plain 44 byte Wav. Not an extended header or one with other metadata.

I've not trapped the above, so the program may crash/freeze if you don't comply with the above. I keep meaning to add traps, but lack of round tuits I'm afraid. :-/

The GL58 file was too short to work here. I used sox to concat two copies and double its length (having first used sox to generate a stereo version and discover it was just too short as supplied.)
 
GL58 file is 24.6 seconds long so should be OK. Have made stereo in Audacity then saved as wav. Header viewed in hex editor has 'd' 'a' 't' 'a' starting at offset 24h so maybe this is the problem?
 
Thanks, Paul. Sorry that I persistently seem to make the same bloopers like the "d". Partly my memory, partly because I adapt previous progs when writing news ones, and duly import old mistakes!

The point about printf family is new to me, and the gcc I use doesn't warn me that I've noticed. But that may mean I didn't recognise when it does! :-/

Shows that I've never taken any courses on computer programming at all, just hack and see.
On Linux I compiled with,

Code:
paul@tristan:~/audio/audiomisc$ gcc -O3 -o WowAndFlutter LP_WowAndFlutter_with_vsz.c -lm

and without asking for warnings I get stuff like,

Code:
LP_WowAndFlutter_with_vsz.c: In function ‘output_veusz’:
LP_WowAndFlutter_with_vsz.c:241:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lf",&number_rotations);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The purpose of that is that if the string doesn't convert you will carry on and use the uninitialized contents of 'number_rotations' regardless.

and

Code:
In file included from /usr/include/stdio.h:867,
                 from LP_WowAndFlutter_with_vsz.c:3:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:10: note: ‘__builtin___sprintf_chk’ output between 13 and 1036 bytes into a destination of size 1024
   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       __bos (__s), __fmt, __va_arg_pack ());
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

which is all jolly helpful. In these cases these are benign...
 
Paul

i get the crashing too under Win10. It opens a terminal window and closes it again almost immediately

sorry to be a pita
You have to make a 'Results' directory under the directory you are working in.

My test 'working' directory looks like,

Code:
PS C:\Users\paul\source\repos\AudioMisc\WowAndFlutter\working> dir

    Directory: C:\Users\paul\source\repos\AudioMisc\WowAndFlutter\working

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       04/10/2019     16:31                Results
-a----       02/10/2019     16:37        4346176 GL58 3kHz stereo.wav
-a----       03/10/2019     16:38            853 PolarFooter
-a----       02/10/2019     16:05           7582 TwoPolars.vsz
-a----       03/10/2019     16:50         180736 WowAndFlutter.exe

PS C:\Users\paul\source\repos\AudioMisc\WowAndFlutter\working>

And a 'run' looks like,

Code:
PS C:\Users\paul\source\repos\AudioMisc\WowAndFlutter\working> .\WowAndFlutter '.\GL58 3kHz stereo.wav'
  LP_WowAndFlutter Ver 0.20 2nd Oct 2019
  =========================================

This lets you carry out Wow and Flutter analysis.
Please read the Help inside the application before first use.
This version outputs Veusz files (Polar).
Application directory = C:\Users\paul\source\repos\AudioMisc\WowAndFlutter\working
Output into directory = C:\Users\paul\source\repos\AudioMisc\WowAndFlutter\working/Results
Input from file = .\GL58 3kHz stereo.wav

Input file leafname = GL58 3kHz stereo.wav
ChunkID = RIFF
Chunk Size = 4346168
Format = WAVE

Subchunk1ID = fmt
Subchunk1Size = 16 [should be 16 for LPCM]
AudioFormat = 1 [should be 1 for LPCM]
Number of Channels = 2
Sample Rate = 44100 Samples per sec
Byte Rate = 176400 Bytes per sec
Block Align = 4

Bits per sample = 16
Bytes per sample = 2

Subchunk2ID = data
Subchunk2Size = 4346132 [Number of Data payload bytes]

WAV data start located OK
Sample pairs per sec = 44100
Duration = 24.6379 sec

sample interval =    22.676 microsec
block size = 441000  Duration =  10.00 sec
Enter start time of section to transform [seconds]
   => 10

Requested start time   10.00
Start sample pair 441000 = At Byte 1764000
reading from .\GL58 3kHz stereo.wav
Loading 16bit payload
Block size read = 1764000
Left  dc = 0.0000  rms = 0.1129
Right dc = 0.0000  rms = 0.1129
Apply 200Hz highpass filter.
delta = 0.0281
Left  5 to 440998 has 29737 cycles
Right 5 to 440998 has 29737 cycles
Frequencies 2973.7472 Hz Left  2973.7472 Right
Left chosen
Found f0_counter = 2973.7472

Now examine chunks
Ended with i = 902
Now doing spectrum of variations - please wait...
Saving rate v time to C:\Users\paul\source\repos\AudioMisc\WowAndFlutter\working/Results/ratepercentVtime.csv
Enter number of rotations for polar plot [Max = 5.0]
 => 5
Footer at C:\Users\paul\source\repos\AudioMisc\WowAndFlutter\working/PolarFooter
 388 values offscale for histogram plot.
Histogram left + right raw count 1294
  weighted count 1518
Limit raw of 1234 at +/- 233 [ 0.466 percent]
Limit weighted 1446 at +/- 220 [ 0.440 percent]

Done!
PS C:\Users\paul\source\repos\AudioMisc\WowAndFlutter\working>

You can drop the wav on the executable in Explorer but I think it will run and exit, so all you will get is the Results files. Better to open a command line and run it with typing as above. Old style...
 
On Linux I compiled with,

Code:
paul@tristan:~/audio/audiomisc$ gcc -O3 -o WowAndFlutter LP_WowAndFlutter_with_vsz.c -lm

and without asking for warnings I get stuff like,

Code:
LP_WowAndFlutter_with_vsz.c: In function ‘output_veusz’:
LP_WowAndFlutter_with_vsz.c:241:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lf",&number_rotations);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The purpose of that is that if the string doesn't convert you will carry on and use the uninitialized contents of 'number_rotations' regardless.
...

Ah! OK, yes, I take for granted the scanf will find the required value and format.
 
GL58 file is 24.6 seconds long so should be OK. Have made stereo in Audacity then saved as wav. Header viewed in hex editor has 'd' 'a' 't' 'a' starting at offset 24h so maybe this is the problem?

Yes, that may be the problem. I assume 44-byte plain headers as I use another program to remove any extra header blocks before using a wave file.

FWIW I converted the flac version you provided using sox, and it may be that's a way to avoid any 'extras' being in the wave version.
 
If you choose 'other uncompressed files' in the Audacity export you can select WAV or WAVEX. I think I just used a 16 bit PCM Wav export and that seems OK.
 
Just a quick note of thanks to Jim and Paul, I now have the Windows version working and am now getting some useful results.
 
At some point I'll add more to the Veusz output files and try and remember to fix my usual bloopers wrt trapping input, etc. But it will probably be a week or two as I'll now focus back on what I'm writing.
 
At some point I'll add more to the Veusz output files and try and remember to fix my usual bloopers wrt trapping input, etc. But it will probably be a week or two as I'll now focus back on what I'm writing.

Jim

One final request as my old brain seems to be failing me in taking your 'apps' csv file and modifying it to enable me to make a plot similar to this

A second output of a veusz plot similar to this.

sq_geddon_recap_polar.png


I think there is a use for the both your normal plot showing the speed changes in detail and the more overview one above.
 
OK, I'll try to leave 'as is' the present CSV output and only add new Veusz stuff.

Note, though that if you modify the 'PolarFooter' file you can get it to look similar to the above. The relevant lines are

Set('minradius', -0.5)
Set('maxradius', 0.5)

Change the -0.5 to 0.0, and the 0.5 to 1.5

You can also remove the 'blobs' by editing (or using Vesuz).
 
Jim

Thanks

Finally worked it out with your help

Worked best for me with

Set('minradius', -3.5)
Set('maxradius', 0.5)
 
Jim

One final request as my old brain seems to be failing me in taking your 'apps' csv file and modifying it to enable me to make a plot similar to this

A second output of a veusz plot similar to this.

sq_geddon_recap_polar.png


I think there is a use for the both your normal plot showing the speed changes in detail and the more overview one above.
That's with the Analogue Productions disc? It has a distinctive wobble on one rotation (lower left on this plot) that is visible on most plots. It puts the minutiae of TT wobble into some perspective.
 


advertisement


Back
Top