Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Scroll Documents: Update page title prefix

Overview

Performs transfer function measurements

Discussion

This module will periodically output the stimulus signal. On the measurement side, the received signal of length L will be measured and averaged. The number of times that the stimulus signal is output and the received signal measured is numReps. The average of the recorded signal is in the response buffer. The number of times to repeat the stimulus before starting the acquisition is the numPreCycles. The trigger is a parameter which the PC sets to trigger the measurement. This will initially be 0 (waiting), then set to 1 by PC (start measurement). Once the measurement is completed, it will be set to 0.

...

  1. Run the layout in Designer.

  2. Start a measurment using the module's inspector.

  3. Get the running layouts structure in Matlab:

    Code Block
    >> GSYS = get_gsys();

  4. Next read out the stimulus and response in Matlab command window:

    Code Block
    >> x = GSYS.SYS.MeasurementV2_1.response;
    >> z = GSYS.SYS.MeasurementV2_1.stimulus;

  5. Next compute the transfer function and plot it. For example, if you have the signal processing toolbox you can do:

    Code Block
    >>[tf, f] = tfestimate(z,x,[],[],[],48000);
    >> plot(f,abs(tf));shg

Type Definition

Code Block
typedef struct _ModuleMeasurementV2
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 L;                                      // Length of the stimulus signal.
    INT32 numReps;                                // Number of times to repeat the stimulus and average the result
    INT32 numPreCycles;                           // Number of times to repeat the stimulus before starting the acquisition
    INT32 trigger;                                // state variable/parameter which the PC sets to trigger the measurement.
    INT32 readIndex;                              // Index used for circular reading
    INT32 stateIndex;                             // Index used for state
    INT32 cnt;                                    // Index used to measure the response
    FLOAT32* stimulus;                            // Column vector of length L holding the stimulus signal
    FLOAT32* response;                            // Holds the time average measured signal
} ModuleMeasurementV2Class;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

L

int

const

0

16380

Unrestricted

numReps

int

parameter

0

16

1:1024

numPreCycles

int

parameter

0

2

1:4

trigger

int

parameter

0

0

0:1

readIndex

int

state

1

0

Unrestricted

stateIndex

int

state

1

0

Unrestricted

cnt

int

state

1

0

Unrestricted

stimulus

float*

parameter

0

[16384 x 1]

Unrestricted

response

float*

derived

0

[1 x 16384]

Unrestricted

Pins

Input Pins

Name: measure

Description: measured audio input

...

Sample rate range: Unrestricted

Complex support: Real

Output Pins

Name: stimulus

Description: stimulus output

Data type: float

MATLAB Usage

File Name: measurement_v2_module.m

...