Skip to content

LogicCompareFract32

Overview

General logical comparison module

Discussion

This module implements a general purpose logical comparison module that is capable of realizing many different comparison functions. The behavior of the logic compare is controlled by the compareType parameter. compareType is an integer in the range from 0 to 5 inclusive. The following list discusses the various compare operations types, compareType = 0, performs logic equal operation.

compareType = 1, performs logic not equal operation.

compareType = 2, performs logic lessthan operation.

compareType = 3, performs logic lessthan equal operation.

compareType = 4, performs logic greaterthan operation.

compareType = 5, performs logic greaterthan equal operation.

Module Pack

Standard

ClassID

classID = 149

Type Definition

typedef struct _ModuleLogicCompareFract32
{
ModuleInstanceDescriptor instance;            // Common Audio Weaver module instance structure
INT32 compareType;                            // Selects the type of comparison that is implemented by the module: EQUAL=0 NOTEQUAL=1 LESSTHAN=2 LESSOREQUAL=3 GREATERTHAN=4 GREATEROREQUAL=5
} ModuleLogicCompareFract32Class;

Variables

Properties

Name Type Usage isHidden Default Value Range Units
compareType int parameter 0 0 0:5

Pins

Input Pins

Name in1
Description Audio input 1
Data type fract32
Channel range Unrestricted
Block size range Unrestricted
Sample rate range Unrestricted
Complex support Real
Name in2
Description Audio input 2
Data type fract32
Channel range Unrestricted
Block size range Unrestricted
Sample rate range Unrestricted
Complex support Real

Output Pins

Name out
Description Logical output
Data Type int

Matlab Usage

File Name: logic_compare_fract32_module.m 
 M=logic_compare_fract32_module(NAME) 
 Creates a general purpose comparison module that implements a number 
 of standard logical operations.  The module has two input pins, each 
 with an arbitrary number of interleaved channel.  The module performs 
 the comparison on a sample-by-sample basis.  Arguments: 
    NAME - name of the module. 

 The comparison operation implemented by the module is based on the variable 
   compareType - integer specifying the type of the design (details below). 

 The variable compareType determines what comparison function is run: 
   0 = performs logical  equal operation 
   1 = performs logical  not equal operation 
   2 = performs logical  less than operation 
   3 = performs logical  less than equal operation 
   4 = performs logical  greater operation 
   5 = performs logical  greater than equal operation 

Copyright (c) 2026 DSP Concepts, Inc.