Automated Measurements

tomnovelty

New Member
Thread Starter
Joined
May 6, 2024
Messages
2
Good morning, everybody.
I'm working on a draft of automatic measures.
I bought the REW license and I am facing some issues.

I have to individually measure the frequency response of loudspeakers. To do this, I do a sweep, then I compare the obtained curve to the reference curve that I inserted into the software.

However, I cannot open my reference curve in the software via the API. Despite several readings in the help, I can't find how to open a measure in the software (open an already built . mdat file).

On the other hand, I can't get the curve drawn in the software either. The API does the sweep well but I can't open the curve from an external link.

Here is the procedure I perform:
- Configuring audio settings
- I'm measuring the loudspeaker.
- I smooth the result.
- I can't do it right now, but I'm opening the reference curve.
- I'm doing the A/B calculation.
- Then I want to display the curve obtained at the end of the result.

Thank you in advance.
Tom
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,406
POST to /measurements/command, example below loads two files:
{ "command": "Load", "parameters": [ "C:/Users/myusername/REW/file1.mdat", "C:/Users/myusername/REW/file2.mdat" ] }
 

tomnovelty

New Member
Thread Starter
Joined
May 6, 2024
Messages
2
Thank you for your answer.
I managed to do almost anything I wanted.
My last step is to export the result.
How do I capture the final graph via the API? Or how can I export the measurement data as a text file via the API?
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,406
There are no export endpoints, but you can retrieve the frequency response as a Base64-encoded string and do whatever you wish with it after that:

The frequency response for a measurement can be obtained by a GET at /measurements/:id/frequency-response. A FrequencyResponse object is returned, with a smoothing setting, a start frequency, a points-per-octave figure (for log-spaced data) or a frequency step value (for linear-spaced data), and Base64-encoded strings of response magnitudes and phases generated from the raw bytes of the 32-bit float magnitude and phase values at each frequency. The default unit for the magnitude data is SPL but other units can be requested by including a unit query value in the url, e.g. ?unit=dBFS. The list of units available can be read from /measurements/frequency-response/units. The default smoothing is whatever the measurement currently uses, but other smoothings can be requested by including a smoothing query value in the url, e.g. ?smoothing="1/12". The list of smoothing choices can be read from /measurements/frequency-response/smoothing-choices. Whether the returned data is log-spaced or linear-spaced depends on the measurement, but log-spaced data can be forced by including a ppo query value in the url, e.g. ?ppo=96. Note that to avoid sampling artefacts log-spaced data will be smoothed to ppo/2 if a greater smoothing has not already been applied.
 

u.froemberg

Registered
Joined
May 27, 2017
Messages
12
Hello everyone,

I am currently trying to perform multi-channel measurements with my RME audio interfaces using REW Pro 5.40 Beta 29.

First of all, I would like to calibrate the relevant analogue input/output combinations with direct loops in order to be able to compensate for their complex transfer functions including delays/latencies in later measurements. To do this, I would have to create a soundcard calibration file for each sampling rate and input/output combination, preferably automatically. I had hoped that the associated calibration files could then be applied automatically (as with the microphone inputs). This doesn't seem to be the case (yet) or is there another practicable option or is this function already on the agenda for later releases?

I have also noticed that a real normalisation/offset with a sensitivity entry in the calibration files does not work or has the syntax "Sensitivity ±n.nnn dBXY" changed? I would like to be able to compensate the gain differences of several simultaneously active channels with the same commentable sensitivity entry without having to change all magnitudes in the calibration files.

Thanks for any help and other solutions are also very welcome.

Uwe
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,406
To do this, I would have to create a soundcard calibration file for each sampling rate and input/output combination, preferably automatically. I had hoped that the associated calibration files could then be applied automatically (as with the microphone inputs). This doesn't seem to be the case (yet) or is there another practicable option or is this function already on the agenda for later releases?
If you use the Calibrate soundcard button on the soundcard preferences the file that is produced will be associated with the sample rate at which it was generated and selected automatically for that rate in future. REW will also show a warning if a file being used for soundcard cal was produced at a different sample rate. Soundcard cal files only compensate for the response, they do not try to compensate for latency.

Mic cal files can have a sensitivity entry, that can apply to an individual channel if the "Separate cal for each input" option is selected for that input device/input combination in the Cal files preferences.
 

u.froemberg

Registered
Joined
May 27, 2017
Messages
12
I wanted to prepare measurements with sequential outputs and multiple inputs and calibrate all combinations of inputs and outputs in order to eliminate deviations between the channels. Since the transfer functions between input i and output j of an audio interface always interact, inputs and outputs cannot be calibrated separately. The calibration data is therefore dependent on both the active output and input. Separate soundcard calibrations are therefore required for each input/output combination and also for each sampling rate. With m outputs, n inputs and k sampling rates, this would mean m x n x k calibration files, which would then have to be assigned automatically for sequential and multiple measurements.

I had now tried to use loop measurements separately for each output with the multiple inputs. However, these cannot be used in the intended way, as apparently only the microphone calibrations can be assigned automatically. If I see it correctly, the soundcard calibration in the settings dialogue can also only create individual calibrations and I cannot understand whether and how soundcard calibration files can also be assigned depending on the currently active output and input.

In any case, such a Pro function would be great for sequential/multiple measurements.

With a sensitivity/gain entry in the soundcard calibrations, I had hoped to save myself a lot of work when creating many calibration files, at least for frequency-independent channel deviations.
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,406
Soundcard calibration is based on the underlying single-output, single-input measurement methodology, there isn't any support for input-output combination dependence. That would be quite complex to manage. A possibility would be to use the API to manage that outside REW.
 

u.froemberg

Registered
Joined
May 27, 2017
Messages
12
Thank you for the clarification. I have not yet looked into the API in detail. Does REW and the API have corresponding functions, i.e. for the automatic creation of calibration files and corresponding assignment for sequential and multiple measurements? Where are the corresponding functions documented?

Many thanks for your support
 

John Mulcahy

REW Author
Joined
Apr 3, 2017
Messages
7,406
The first post in that thread has links to the help and instructions on how to access SwaggerUI for a browser-based overview of the API. There's an endpoint to set the soundard cal file to use and endpoints to make measurements. There isn't an endpoint to run the soundcard cal file generation process.
 
Top Bottom