[Mataa-info] help with impedance model not working
Status: Beta
Brought to you by:
mbrennwa
From: vero s. <swe...@gm...> - 2014-04-22 05:28:25
|
Dear Matthias, First let me say how glad i am to see that you are still supporting this great suite of matlab tools with the latest release a few days ago - I think it is a wonderful contribution to the audio community and really a fine work! I am just trying MATAA for the first time and one of the first task i'm trying to experiment with is the impedance modeling and fitting functions. I thought I would try something simple, which is the following script (in matlab 2014a) %%%%%%%%%%%%%%% Rdc = 5; f0 = 100; Qe = 0.5; Qm = 3; L1 = 0.002; L2 = 0.001; R2 = 1; f = logspace(1,3,100); [mag,phase] = mataa_impedance_speaker_model (f,Rdc,f0,Qe,Qm,L1,L2,R2); %generate impedance data [Rdcf,f0f,Qef,Qmf,L1f,L2f,R2f] = mataa_impedance_fit_speaker (f,mag,phase); %recover the speaker parameters %%%%%%%%%%%%%%%% The mataa_impedance_speaker_model function works fine after a minor change to the last line %phase = arg (Z) / pi * 180; %original phase = angle (Z) / pi * 180; % changed but the\ function mataa_impedance_fit_speaker is giving me some problems. The errors I get: Error: File: mataa_impedance_fit_speaker.m Line: 86 Column: 11 The expression to the left of the equals sign is not a valid target for an assignment. These are related to the lines which read: % find best-fit values of Rdc, f0, Q, L1, L2, and R2: global ff = f; global ff_low = f (i_low); ... I assume these functions are working fine in the version of Matlab you have (which version is that?) - are there known incompatibility issues with more recent Matlab versions? Lastly, I wanted to submit a feature request - have you considered adding Farina sweep decomposition? In this way, both the fundamental as well as the harmonic distortion can be extracted from the same single sweep. I think the same exponential sweep from the generator can still be used, only a new analysis function is needed. Best wishes Alex |