Skip to main content
Skip table of contents

ComplexDivide

Overview

Multi-input complex divide

Discussion

Multi-input complex divide module. This block takes two input pins and has one output pin. The first input pin contains channels of sample data to be divided by the corresponding channel sample in the second input pin.

The second input pin must have either a single channel or the same number of channels as the first input pin.

If the second pin has only a single channel then each channel in the first input pin is divided by the corresponding sample in this single channel

The input samples may be all real or all complex but the output pin samples are always complex even if both input pins contain only real samples

This module does not protect against divide-by-zero conditions.

Type Definition

CODE
typedef struct _ModuleComplexDivide
{
    ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
} ModuleComplexDivideClass;

Pins

Input Pins

Name: in1

Description: Audio input

Data type: float

Channel range: Unrestricted

Block size range: Unrestricted

Sample rate range: Unrestricted

Complex support: Real and Complex

Name: in2

Description: Audio input

Data type: float

Channel range: Unrestricted

Block size range: Unrestricted

Sample rate range: Unrestricted

Complex support: Real and Complex

Output Pins

Name: out

Description: Audio output

Data type: float

MATLAB Usage

File Name: complex_divide_module.m

CODE
 M=complex_divide_module(NAME)
 Creates a multi-input divide module for use in the Audio Weaver.
 It performs four types of division:
 1. ComplexByComplex Division
 2. RealByComplex Division
 3. ComplexByReal Division
 4. RealByReal Division with output Complex
 Arguments:
    NAME - name of the module.
 Any one of the two input pins may be real or complex.
 The output pin is always complex.
 For Bypass test, The input pin values are passed over to the output
 pin. If the first input pin is real then the real values are copied to
 the real part of the output and the imaginary values of the output pin
 are made zeroes.
 The output pin number of channels must be the same as the first input 
 pin number of channels.
 The second input pin must have a single channel or the same number of
 channels as the first pin.
 The first pin channel samples are divided by the second pin channels.
 Copyright (c) 2020 DSP Concepts, Inc.  All Rights Reserved.
 Author:  Chris Perry

JavaScript errors detected

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

If this problem persists, please contact our support.