Giter Site home page Giter Site logo

mataa's People

Contributors

mbrennwa avatar soundart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mataa's Issues

[Suggestion] Low frequency loudspeaker impedance magnitude fit

To test if you consider it worthwhile.
A simplified model of impedance magnitude and a function to fit the model parameters to measured data.
The fit seems to be not excellent but good enough to get usable Thiele-Small parameters.

function [mag] = impedance_speaker_model (f,params)

Rdc=params(1);
f0=params(2);
Qe=params(3);
Qm=params(4);
Le=params(5);

w0 = 2pif0;
w = 2pif;

% low-frequency impedance (resonance peak, LCR part):
Res = Rdc*Qm/Qe;
Ces = Qe/w0/Rdc;
Les = 1/w0^2/Ces;

ZCes = 1./(iwCes);
ZLes = iwLes;
Zlow = 1 ./ ( 1/Res + 1./ZCes + 1./ZLes );

% total impedance:
Z = Rdc + w * Le + Zlow;
mag = abs (Z);

endfunction

function [Rdc,f0,Qe,Qm,Le] = impedance_fit_speaker (f,mag)

% guess starting value for Rdc:
Rdc = min (mag);

% guess starting values for f0:
u = diff (mag);
F = ( f(1:end-1) + f(2:end))/2;
[u1,k1] = max (u); [u2,k2] = min (u);
if ~exist ('f0','var')
f0 = (F(k1)+F(k2))/2;
endif
clear F

% estimate impedance at f0:
[u,k] = min(abs(f-f0));
Rmax = mag(k);
clear u
clear k

% estimate f1 and f2:
k = find(f<f0);
[u,k] = min(abs(mag(k)-sqrt(Rmax*Rdc)));
f1 = f(k);
clear u
clear k
f2 = f0^2/f1;

% guess starting values for Qe and Qm:
Qm = f0/(f2-f1)*sqrt(Rmax/Rdc);
Qe = Qm / (Rmax/Rdc-1);

% starting value for Le
Le = 0;

clear f1
clear f2

inputparams = [Rdc,f0,Qe,Qm,Le];
[f,p,cvg,iter,corp,covp]=leasqr(f,mag,inputparams,"impedance_speaker_model");
Rdc=p(1);
f0=p(2);
Qe=p(3);
Qm=p(4);
Le=p(5);

endfunction

Issue running RC high-pass filter

Just starting with the example RC high-pass filter...

w = mataa_signal_generator('white',96000,0.3);
h = mataa_measure_IR(w,96000);
Creating / resetting to MATAA default settings (command: save -mat ..mataa_settings.mat mataa_settings ; )...

scalar structure containing the fields:

plotColor = b
plotWindow_IR =  1
plotWindow_SR =  2
plotWindow_FR =  3
plotWindow_CSD =  4
plotWindow_ETC =  5
plotWindow_HD =  6
plotWindow_impedance =  7
plotWindow_TBES =  8
openPlotAfterSafe =  1
channel_DUT =  1
channel_REF =  2
interchannel_delay = 0

...done.
error: 'latency' undefined near line 73 column 67
error: evaluating argument list element number 3
error: called from:
error: C:/Users/findelic/Desktop/mataa-User/mataa_tools\mataa_measure_IR.m at line 73, column 18

compile warnings, format specifier

When compiling TestTonePA19.c as per the instructions in the README, I get warnings on lines:
279, 286, 373, and 383 saying tht format %d expects an int but gets an long unsigned int.

The format for all four should be changed to %lu

Compiling TestDevicesPA19.c I get warnings on lines 140 and 175, too many arguments for format
both printf statements need to be fixed.

Update mataa_impedance_fit_speaker.m line 138

Hello Mathias,
I would follow the standard procedure of forking, modifying and making a pull request, but I believe all is needed is simply to change line 138 in mataa_impedance_fit_speaker.m, writing mataa_impedance_speaker_model_LR2 instead of mataa_impedance_speaker_model.
Best regards,
Esteban

ld cannot find -lasound

This error occurs when compiling TestTonePA19.c and TestDevicePA19.c per the instructions in the README
gcc -lrt -lasound -lpthread -o TestTonePA19 TestTonePA19.c libportaudio.a
...
/usr/bin/ld: cannot find -lasound
collect2: error: ld returned 1 exit status

Are there other files I need to copy from elsewhere, or paths I need to define?

Note this is regardless of the printf format warnings mentioned in my other issue.
I am using Ubuntu 18.10 in a VM on Windows 10.
and using freshly downloaded MATAA and portaudio files.
I am following the README as written (i.e. with no assumptions made by me.)

[question] - how to calibrate sound card and setting output level

Hello Matt. Regarding your MATAA software I have a couple of questions:

  1. how can I specify output level when emitting a signal like this:
    s = mataa_signal_generator(’square’,96000,0.1,1000);
    ​res = mataa_measure_signal_response(s,96000);

to say 1Vpp..?

  1. how can I calibrate the output signal of my sound card, so that when doing the previous, signal would be exactly 1Vpp, and not more, not less??

Thanks!
I really hope this software how help me with the analisys of my tube amp!

Btw, what external sound card would you recommend? I only have the integrated one of my laptop. And that seems to only support 44100 sample rate..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.