DiAna, a software Distortion Analyzer

AX tech editor
Joined 2002
Paid Member
I was trained on a 6502 and Z80 in assembler but I do appreciate the ease of the new whether it's in a text editor or IDE. Both have their virtues. Micros these days have graduated to C. I didn't like the syntax of CPP so I avoided that.

We went cutting edge in '82. Motorola 68000 chip and Pascal!
 
Last edited:
Edmond,
Does DiAna have to have a strong fundamental waveform to function?
Could DiAna be used from the monitor readout port of a conventional distortion analyzer where the fundamental has been largely removed?
Cheers,

Hi David,

The fundamental waveform may de suppressed to a certain extent. How much depends on the distortion level. The lower the distortion, the more suppression is allowed. Actually, your question comes down to how much distortion may be present (as a percentage of the fundament) anyway. Normally I would say 10%. How much in reality, you can easily figure that out by yourself by means of simalation. Yes, DiAna can do this too (it's a remainder of the development phase, but still useful and funny to play with).
Enfin, Go to Preferences->Simulation, fill in some harmonic level (and phase), set Mode to Simulate data and run a Distortion analysis. Try different levels of distortion and see if the analysis is still in accordance with the specified levels. Harmonics above -20 dB will give an error message, see pic. You can overrule this error by clicking another four times on the OK button.
Good luck.

Cheers, E.

PS: Now I'm really away. Till next year.
 

Attachments

  • Simulation.png
    Simulation.png
    10.9 KB · Views: 362
We went cutting edge in '82. Motorola 68000 chip and Pascal!

Wow, you guys are showning your age. I really liked the punch card
and running my programs in FORTRAN 4+ if I recall.

We were just moving from cards to a terminal, now that was a big deal.

And oh but the Joys of CP/M and upstart DOS.

Then the elegance of which you speak jan. The 68000 family
and another upstart...Apple.

@Davada, that's a good point and I agree. It's nice to get software
and hardware together in one package...it usually works much better
for everyone too.

Cheers,
 
Member
Joined 2004
Paid Member
Gees Sync you have a five year old. If you are as old as you let on to be. CP/M and Apple starting up?
Now I feel old. My first computer experience was a Bunker Ramp tube system run from punch tape. I worked with discrete transistor/tunnel diode computers 14" disk drives, 10" tape drives with vacuum capstans, etc. The boot loader was keyed in through 24 toggle switches in the front panel. Assembler and COBAL were the lingua franca. No wonder I ditched that for audio.
 
Edmond I have my spice simulation setup to output to a ,wav file. I ran off 1 sec of 1kHz 1Vp to a file and imported it to DiAna. I get a message 'premature end of file'. Is the file too short.
Apparently, but why??? 1sec. should be long enough.
Also the best LTspice will do is 16 bit 44.1k. DiAna reports 16 bit 96k.
Weird!
Hi David,

First, Happy New Year.
Just email that file to me and I will figure out what went wrong.

Cheers, E.
 
Member
Joined 2004
Paid Member
If anyone is wondering this testing is why good software doesn't happen quickly and gets expensive in the commercial world. There is no way to avoid it. And not doing it adequately really bites. Look at Apple's problems with trying to manage around weak batteries for an example of how not to do software development.
 
@ David and Demian,

DiAna wasn't designed to read and process wav files from LT spice or any other simulator (let alone to cope with a corrupted registry). Nevertheless, after a minor tweak, I was able to analyze David's wav file (see pic). There wasn't a bug at all, only one of the setting was incompatible with a sampling rate of 44.1kHz and 16 bits resolution. More on this tomorrow (as it is bedtime now).

Cheers, E.
 

Attachments

  • DavidExport.jpg
    DavidExport.jpg
    90.2 KB · Views: 222
Externally generated wav files

Edmond I have my spice simulation setup to output to a ,wav file. I ran off 1 sec of 1kHz 1Vp to a file and imported it to DiAna. I get a message 'premature end of file'. Is the file too short. Also the best LTspice will do is 16 bit 44.1k. DiAna reports 16 bit 96k.

Hi David,

The error message 'premature end of file' popped up because the program tried to determine the frequency within too narrow limits: +/- 0.1ppm. If the wav file is generated by DiAna itself, this narrow limit creates no problem, but when externally generated, this limit is too stringent. So I have relaxed it and set it to 10ppm. I have also changed the error message to: "unable to settle initial parameters". Hope this is less cryptic. Also make sure that the frequency as specified in the distortion preference menu, doesn't differ to much from the real frequency, say no more 10%, and set the Record length to the lowest possible value, i.e. 1K.

>"Also the best LTspice will do is 16 bit 44.1k. DiAna reports 16 bit 96k"
Indeed, 96k is wrong. Apparently, this was the sampling rate of the sound card. Now the program (correctly) displays the sampling rate as specified in the wav file. An updated version (1.47.7) can be download from my website.

Last but not least, reading and writing wav file was a last minute addition in order to cripple the demo version. As it appears too cumbersome, I've removed this restriction and re-enabled the Full duplex mode in more recent versions. Actually, this means that the possibility to handle wav files becomes a superfluous and obsolete feature. Nevertheless this feature is still there as it would prove useful in the future. But please don't blame me or DiAna if this "encore" doesn't work under unforeseen conditions.

Cheers,
E.
 
Hi kannan,

As far as I understand, David has created wav files in two ways:
1. Generated by DiAna, mode set to "Write to file".
2. Generated by LTspice (don't know all the details).
I either case you can check the wav file simply by playing it back by means of VLC media player or a similar program.
Regarding your first question, I suppose you have set Mode to "Read from file", under the file menu specified which file to read and press the Distortion button. Right? So the problems is that it does nothing. Right?
Instead of listening to the file, you also can check it pressing the "Monitor" button. Now the signal should be visible in the lower pane.
But first, let's keep things simple and check whether DiAna works when Mode is set to "Full duplex". In this case you don't have to worry about files at all. Have you tried this already?

Cheers,
E.
 
Last edited:
Hi Edmond
I tried full duplex mode and it did not work. I will do some more testing today evening and post my findings. However when I tried Full duplex mode i did not see waveform in the monitor window? I was using the external input to RTX. Is it possible to use only ADC part disabling the DAC part ? ( in the setting)
 
AX tech editor
Joined 2002
Paid Member
Hi David,

The error message 'premature end of file' popped up because the program tried to determine the frequency within too narrow limits: +/- 0.1ppm. If the wav file is generated by DiAna itself, this narrow limit creates no problem, but when externally generated, this limit is too stringent. So I have relaxed it and set it to 10ppm. I have also changed the error message to: "unable to settle initial parameters". Hope this is less cryptic. Also make sure that the frequency as specified in the distortion preference menu, doesn't differ to much from the real frequency, say no more 10%, and set the Record length to the lowest possible value, i.e. 1K.

>"Also the best LTspice will do is 16 bit 44.1k. DiAna reports 16 bit 96k"
Indeed, 96k is wrong. Apparently, this was the sampling rate of the sound card. Now the program (correctly) displays the sampling rate as specified in the wav file. An updated version (1.47.7) can be download from my website.

Last but not least, reading and writing wav file was a last minute addition in order to cripple the demo version. As it appears too cumbersome, I've removed this restriction and re-enabled the Full duplex mode in more recent versions. Actually, this means that the possibility to handle wav files becomes a superfluous and obsolete feature. Nevertheless this feature is still there as it would prove useful in the future. But please don't blame me or DiAna if this "encore" doesn't work under unforeseen conditions.

Cheers,
E.

I very much appreciate this feature (analyse .wav) as I can sometimes get some clues from the residual wave form!

Thanks for leaving it in!

Jan
 
Hi Edmond
I tried full duplex mode and it did not work. I will do some more testing today evening and post my findings. However when I tried Full duplex mode i did not see waveform in the monitor window?
Hi kannan,

In post 163 you wrote: "It works for RTX without issues" So I'm not sure what does work and what does not work.
In order to see the waveform in the monitor window (the lower pane), the option "Monitor on" in the Preference Distortion menu has to be enabled. Also, you only can see the waveform during sampling of the ADC. When all done, this waveform is replaced by the spectrum. Furthermore, have you tried the cursor keys to adjust the monitor sensitivity (vertical axis) and time base (horizontal axis)?
I was using the external input to RTX.
Do you mean the ADC input? Also, is there an internal input as well? (Remember, I don't an RTX63001, hence these questions)
Is it possible to use only ADC part disabling the DAC part ? ( in the setting)
Well, in a way. If you use another signal source instead of the DAC, just leave the DAC output unconnected. If, for some reason, you also want to keep the DAC silent, just set the Output level in the Preference Distortion menu to zero. And don't forget to switch on the "External sync" option.

Cheers,
E.