Skip to main content
Skip table of contents

Multiplexor

Overview

Selects one of N inputs

Discussion

This module has a variable number of input pins and routes (or copies) one of these pins to the output. Each input pin must have the same number of channels and block size. The parameter, index specifies which of the input pins to route to the output. index is zero based and must lie in the range of [0 NUMINPIN-1] where NUMINPIN is the number of input pins. If index is outside of the allowable range, it is clipped so that it lies in the proper range.

Note that this module is not smoothed and audible clicks may occur when changing the index at run time. If you need smoothed clickless operation, use the multiplexor_smoothed.m module instead.

The module has an optional control pin when the argument INDEXFROMPIN = 1. The module then has NUMINPIN+1 input pins and the last one is a control pin of size 1x1 which specifies which input signal to use. The control signal is zero based and in the range [0 NUMINPINS-1].

Type Definition

CODE
typedef struct _ModuleMultiplexor
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
    INT32 indexPinFlag;                           // Specifies index pin available or not.
    INT32 index;                                  // Specifies which input pin to route to the output. The index is zero based.
} ModuleMultiplexorClass;

Variables

Properties

Name

Type

Usage

isHidden

Default value

Range

Units

indexPinFlag

int

const

0

1

Unrestricted

index

int

parameter

0

0

0:2

Pins

Input Pins

Name: in1

Description: Input signal

Data type: {float, int, fract32}

Channel range: Unrestricted

Block size range: Unrestricted

Sample rate range: Unrestricted

Complex support: Real and Complex

Name: in2

Description: Input signal

Data type: {float, int, fract32}

Channel range: Unrestricted

Block size range: Unrestricted

Sample rate range: Unrestricted

Complex support: Real and Complex

Name: in3

Description: Input signal

Data type: {float, int, fract32}

Channel range: Unrestricted

Block size range: Unrestricted

Sample rate range: Unrestricted

Complex support: Real and Complex

Name: in0

Description: Index value read from pin

Data type: {float, int, fract32}

Channel range: 1:1:1

Block size range: 1:1:1

Sample rate range: Unrestricted

Complex support: Real and Complex

Output Pins

Name: out

Description: Output signal

Data type: {float, int, fract32}

MATLAB Usage

File Name: multiplexor_module.m

CODE
 M=multiplexor_module(NAME, NUMINPIN, INDEXFROMPIN)
 Creates a multiplexor module for use in the Audio Weaver environment. The
 module has multiple input pins and routes 1 of the inputs to the output. 
 Note, this module performs no smoothing and you may get an audible
 discontinuity when changing the index variable. Use the one of the 
 smoothed multiplexor modules (in BasicAudioFloat32 or BasicAudioFract32)
 to avoid this.  Arguments:
    NAME - name of the module.
    NUMINPIN - number of input pins (default = 2).
    INDEXFROMPIN - 1 takes input from INPUT pin (default = 0).
 
 All input pins must have the same block size and number of channels.
 M=multiplexor_module(NAME, NUMINPIN, INDEXFROMPIN)
 An optional third input argument specifies that the module uses a control
 signal.  When INDEXFROMPIN = 1, then the module has an additional input
 pin (the last one) of size 1x1 (one channel and a block size of 1).  
 The control signal is integer data and is used based.  Values are clipped 
 to the range [0 NUMINPIN-1].

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.