Scimpy: open-source speaker design, impedance measurements, & book (Win/Mac/Linux)

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
I'm in the dark on how to install this. I am a Linux INFANT, but do have a machine running "Studio," mostly for Kodi and because I had the parts to build it. And I have a PC running Windows 7 that is my primary design, audio production and my most powerful machine. A Chromebook, a Galaxy Tablet, and several Raspberry Pi models are also in the mix or easy enough to get in the mix, if needed. I'd LIKE to install the Windows version... am I just not seeing the link(s?) on how / where to get that done?
 
Hello all - I'm back, and have been making more commits. T/S parameter extraction from measured data works MUCH better, and includes frequency dependent voice coil impedance in the model. I've been downloading ZMA files from parts express and testing fitting, it fits exactly on the first shot. Fitting is fast in Linux, but slow on Windows - something to look in to how to fix in the future.

I've actually done the first impedance measurements on a cheap driver, and am working through those kinks before putting that in to the wild.

Next steps before 1.0 release:
  1. Make it easier to install on Windows
  2. Finalize impedance measurements
  3. Some minor UI bugs

Also, I've been working on an open-hardware (CC-BY-SA) power supply, LR4 active cross-over, with individually amped drivers. The work in progress is available on the github site: schematics, PCB design files, BOMs are available for use. (my background is in high speed electronics for medical imaging technology, this is my first "slow" audio board ;-) )

Some answers to questions

How did you make sure there is no data conversion happening in portaudio? (resampling, bit depth coversion, etc)

I read port audio's source code, it is really straightforward. It pulls from the lowest level layer and is pulling in raw bits. It's so raw that you have to handle bit alignment/sizing in your own code because portaudio doesn't even know what the data means (or how to resample it). You do have to worry about buffer over- and under runs. The code manages it.


lso, 436 MB unzipped ! That's just crazy ! There's no way it should need ALL those files .............

Have you tried running yourself on a Win comp, using Wins included DLL's etc etc ?

Yes, it's crazy! I got it down to 130MB, and even that is crazy (on linux the install is ~1MB, but linux has all the libraries already). I have run it on a windows machine, and it works. Fixing windows distribution is on my to-do list, and I have been evaluating nuitka, python-nsist, and pyinstaller a ways to make it easier. For now, I'm trying to just get it feature complete.

Linux install is easier (see https://github.com/maqifrnswa/scimpy, and I am probably going to set up an Ubuntu PPA at some point), but windows might need some instructions.

Current Windows installation instructions (will be made easier in the future once stable releases have been made):
  • Install python (i.e., on windows install miniconda for python 3.6 https://conda.io/miniconda.html)
  • Open Powershell, type "conda update conda"
  • Install git "conda install git"
  • download the source code "git clone git@github.com:maqifrnswa/scimpy.git" (this will place it in a new directory named "scimpy")
  • install needed libraries "conda install matplotlib scipy numpy pandas pyqt pip"
  • install one more library "pip install pyaudio"
  • change directories in to the source code "cd scimpy"
  • run the program "python run.py"

To get the newest code/commits as they are made:
  • Open Powershell, navigate to the directory with the code (e.g., "cd scimpy")
  • get code updates/patches: "git pull"
  • run the program "python run.py"
 
Ubuntu users, I set up a PPA that automatically builds a new release every day.

Code:
sudo add-apt-repository ppa:showard314/scimpy
sudo apt-get update
sudo apt-get install scimpy

will install it, run by clicking on the scimpy icon in your menu or typing "scimpy" in to the terminal.

Also, updating with a new screenshot of a the measured data from a Dayton 8" woofer downloaded from parts express and fit with scimpy. The top plot shows both the measured and extracted model from the raw data - they lie right on top of each other. This is what is needed to extract TS from the measurements from the sound card. Bottom plot is calculated predicted SPL.

scimpy-impfitting.png
 
Ubuntu users, I set up a PPA that automatically builds a new release every day.

Code:
sudo add-apt-repository ppa:showard314/scimpy
sudo apt-get update
sudo apt-get install scimpy

will install it, run by clicking on the scimpy icon in your menu or typing "scimpy" in to the terminal.

Also, updating with a new screenshot of a the measured data from a Dayton 8" woofer downloaded from parts express and fit with scimpy. The top plot shows both the measured and extracted model from the raw data - they lie right on top of each other. This is what is needed to extract TS from the measurements from the sound card. Bottom plot is calculated predicted SPL.

scimpy-impfitting.png

Cool stuff! Seems to work ok, but I got some crashes. Sent error reports, maybe that's useful.

I am still wondering how you're dealing with the potential for data conversion between DAC/ADC and portaudio (see my earlier post).
 
More updates:
Windows binaries are now continuously built every day and available here:
https://ci.appveyor.com/project/maqifrnswa/scimpy/build/artifacts
Download is 95 MB, installation size in 130 MB. Which is huge compared to linux (<1 MB). It runs slower than on linux, not sure why yet, but it works.



Cool stuff! Seems to work ok, but I got some crashes. Sent error reports, maybe that's useful.

I am still wondering how you're dealing with the potential for data conversion between DAC/ADC and portaudio (see my earlier post).

Thanks! The more people testing, the faster we'll find these crashers!

I guess that I considered any data conversion that occurs before portaudio to basically be adding noise to the measurement, and the conversion is happening on both channels, so any error may cancel out. The measurement uses the line-in (or mic-in) right channel to measure current through a test resistor and the left channel to measure the voltage across the driver, so there is no timing issues to worry about. I was thinking that any data conversion wouldn't change one channel relative to the other (both would be scaled the same or introduce the same error). I was considering data scaling as being a random noise source, and you can always reduce or get rid of random noise by averaging.

What do you think?

There is one problem with the technique: I'm using a swept sine technique, which kind of hides THD. I still have to think about that too, test some out. Maybe do a THD test and make sure it is small enough to not have to worry about it.


EDIT: Oh man, I just saw your site:
http://audioroot.net/mataa-mats-audio-analyzer/
that's awesome, I wish I found it earlier! I need to check over your code too!

I couldn't find any real open source solutions when I started this, I wanted it to be open and educational if someone wanted to see how it was done under the hood. But you did a lot of it already! If you have any ideas or tips, I'd appreciate it - I can also check your techniques and algorithms and put a link to your page in the readme.
 
Last edited:
I guess that I considered any data conversion that occurs before portaudio to basically be adding noise to the measurement, and the conversion is happening on both channels, so any error may cancel out.

Well, cancelling may help in some cases, but that's what I am worried about. If bit depth is reduced, signal/noise gets worse. If sample rate is changed, frequency leakage and other complicated things may happen. It would be good to avoid these.

The measurement uses the line-in (or mic-in) right channel to measure current through a test resistor and the left channel to measure the voltage across the driver

Is there a manual with a drawing of the setup?

There is one problem with the technique: I'm using a swept sine technique, which kind of hides THD.

What do you mean by this? Why/how would the sweep hide THD?

EDIT: Oh man, I just saw your site:
MATAA (Mat’s Audio Analyzer) | audioroot
that's awesome, I wish I found it earlier! I need to check over your code too!

Thanks :)
 
Well, cancelling may help in some cases, but that's what I am worried about. If bit depth is reduced, signal/noise gets worse. If sample rate is changed, frequency leakage and other complicated things may happen. It would be good to avoid these.

You're right, frequency leakage is especially bad and ugly, can't really average that away... I haven't had much time to look in to it, but it might rely on the user knowing exactly what their card expects. I'd have to look in to it some more.


Is there a manual with a drawing of the setup?

I'm writing one, it's in progress - but I don't have it yet, mostly because the code doesn't totally let you easily measure impedance yet. That's the last blocker to release. So far I've had to manually hack the code each time, I didn't add the UI yet for the test resistor.


What do you mean by this? Why/how would the sweep hide THD?

It's not so much as hide the THD as much as the THD may make the impedance appear to be different than it really is. I take the whole data stream and take the FFT, assuming that the output was a linear response of the input. But it's really non-linear if there is THD, so the assumption isn't right. See:
https://pdfs.semanticscholar.org/abc8/3f1297e5c033b8322f3d90d7c26423b6cc61.pdf
and section 4 of:
http://www.thinksrs.com/downloads/PDFs/ApplicationNotes/SR1_SweptSine.pdf

Basically, if I put in a pure single-tone frequency f, but because of THD I measure voltage and current at f, 2f, 3f, 4f, etc.. If I then put in a tone at 2f and measure voltage and current, then take all that data and do the FFT, the THD from f will interfere with the output from 2f. perhaps short-time FFTs are needed, but since the swept sine technique is really the same technique everyone else is using, I guess there really isn't a problem just taking the data and doing an FFT.

EDIT: reading over it a bit more, I don't think the effect of harmonic distortions matters for speaker impedance measurements unless you have a very bad drivers. You should be in the small-signal regime anyways, so your THD should hopefully be near zero
 
Last edited:
Basically, if I put in a pure single-tone frequency f, but because of THD I measure voltage and current at f, 2f, 3f, 4f, etc.. If I then put in a tone at 2f and measure voltage and current, then take all that data and do the FFT, the THD from f will interfere with the output from 2f. perhaps short-time FFTs are needed, but since the swept sine technique is really the same technique everyone else is using, I guess there really isn't a problem just taking the data and doing an FFT.

Take a look at Sec. 5 and Fig. 5 of that SRS document you linked. Removing the harmonic distortion products is easy by gating the impulse response.

EDIT: reading over it a bit more, I don't think the effect of harmonic distortions matters for speaker impedance measurements unless you have a very bad drivers. You should be in the small-signal regime anyways, so your THD should hopefully be near zero

Totally agree. I have never seen any substantial effects of harmonic distortion in speaker impedance measurements. Just check the impulse response for the effects shown in the SRS document.
 

By the way, THANK YOU for posting the link to that SRS document; I was not aware of this. The SRS document describes the Farina method so much clearer than the original Farina paper by using using plain maths notation. I had the SRS stuff figured out after reading the Farina document a gazillion times, but was never really sure I got it right (but it looks like I did, which seems like a mere coincidence to me).
 
it's alive!

Hello all - haven't had time to respond to previous posts, but wanted to share this:

First driver measurements, it works :D! A crappy 8 ohm disposable driver <$10, a usb sound card (~$15), a 12 ohm test resistor, one 3.5 mm jack cable, and five alligator clips.

I'm just adding plotting the phase and giving the option to use the fitting system with measured results to extract TS parameters! I'll check up on the bug reports, but I think this is now approaching 1.0 release.

Some todos for 2.0: baffle step/diffraction, passive radiators, cross-over circuits

first_impedance_test.png
 
more updates:
updated documentation:
https://maqifrnswa.github.io/scimpy/doc/html/scimpy.html

image of measurement set up:
test-layout.png


besides making it more user-friendly, impedance testing, TS parameter extraction, and speaker/cabinet modeling is working. At some point I'll make a how to video for youtube, but that might take some time...

Also, in the "boards" directory in github there is an analog signal processor which includes a power supply, bia-amp stereo amplifier, 4th order LR cross-over, baffle-step correction, tweeter/woofer level correction, and tweeter driver alignment delay. also all open source: you have all pcb files, schematics, BOMS (with part numbers). Still a work in progress, not ready for prime time.
 
Update

Hello all,

First - as a spin-off, I've developed a modular analog signal processing system (http://www.diyaudio.com/forums/analog-line-level/307675-masp-modular-analog-signal-processor.html), which is part of the "Scimpy" project. Please check it out, I'm interested in feedback and opinions since I'm new to this game!

Second - everything works fine with the Scimpy software, but I've been busy with day job and haven't had time to clean up the UI so I can "release" it. Once I get that time, I'll do that, I hope make up a how-to video on youtube to make it easier for others to use it.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.