Demo Source Codes
Modal Synthesis Method for Control Systems with an Example. C Code and Octave Script
The C Code:
ModalControl.c/h
Octave GNU file: ModalControl.m
The file is supported all plots of the article, generates the tests for the C code and calculates the Modal Control System.
%************************************************************************/
% Freeware Demo SW from the www.dsp-weimich.com */
% Version 1.0 */
% ModalControl.m */
% Octave Script */
% High-level interactive language for numerical computations */
% Support the article: */
% Modal Synthesis Method for Control Systems */
%************************************************************************/
Control of Non Linear Object Using the Vostrikov’s Localization Method. C Code and Octave Script
The C Code:
LocalizationForNonLinearObject.c/h
Octave GNU file: LocalizationForNonLinearObject.m
The file is supported all plots of the article, generates the tests for the C code and calculates the Localization Control System.
%************************************************************************/
% Freeware Demo SW from the www.dsp-weimich.com */
% Version 1.0 */
% LocalizationForNonLinearObject.m */
% Octave Script */
% High-level interactive language for numerical computations */
% Support the article: */
% Localization Method for Non Linear Control Systems */
%************************************************************************/
Typical Open Loop Bode Diagram for Control Systems. C Code and Octave Script
The C Code:
BodeDiagramType2.c/h
Octave GNU file: OpenLoopMagnitudePhaseRespTypes.m
The file is supported all plots of the article, generates the tests for the C code and calculates the Localization Control System.
%************************************************************************/
% Freeware Demo SW from the www.dsp-weimich.com */
% Version 1.0 */
% LocalizationForNonLinearObject.m */
% Octave Script */
% High-level interactive language for numerical computations */
% Support the article: */
% Localization Method for Non Linear Control Systems */
%************************************************************************/
Control System Using the Localization Method from A. S. Vostrikov. C Code and Octave Script
The C Code:
LocalizationControlSystem.c/h
Octave GNU file: LocalizationControlSystem.m
The file is supported all plots of the article, generates the tests for the C code and calculates the Localization Control System.
%************************************************************************/
% Freeware Demo SW from the www.dsp-weimich.com */
% Version 1.0 */
% LocalizationControlSystem.m */
% Octave Script */
% High-level interactive language for numerical computations */
% Support the article: */
% Localization Method for Linear Control Systems */
%************************************************************************/
Digital Derivative Filter Using Integrators. C Code and Octave Script
The C Code:
DigitalDerivativeFilter.c/h
Octave GNU file: DerivativeFilter.m
The file is supported all plots of the article, generates the tests for the C code and calculates the Derivative Filter.
%************************************************************************/
% Freeware Demo SW from the www.dsp-weimich.com */
% Version 1.0 */
% DerivativeFilter.m */
% Octave Script */
% High-level interactive language for numerical computations */
% Support the article: */
% Digital Derivative Filter Using Integrators. C Code and Octave Script */
%************************************************************************/
Generalized Inverse Matrix on the Example of Converting a Three-Phase Voltage (Ua, Ub, Uc) into a Two-Phase one (Uα, Uβ) in an Electric Motor
Octave GNU file: MatrixGenInverseSupport.m
The Octave script supports the example calculation.
%*********************************************************************/
% Freeware Demo SW from the www.dsp-weimich.com */
% Version 1.0 */
% MatrixFunctionsSupport.m */
% Octave Script */
% High-level interactive language for numerical computations */
% Support the Generalized Inverse Matrix article */
%*********************************************************************/
Matrix Functions for Digital Signal Processing. C Code and Octave Script
The C Code:
MatrixFunctions.c/h
Octave GNU file: MatrixFunctionsSupport.m
The file is supported all plots of the article, generates the tests for the C code and calculates the Matrix Functions.
%*********************************************************************/
% Freeware Demo SW from the www.dsp-weimich.com */
% Version 1.0 */
% MatrixFunctionsSupport.m */
% Octave Script */
% High-level interactive language for numerical computations */
% Support the Matrix Functions article */
%*********************************************************************/
Kalman Filter with Example. C Code and Octave Script
The C Code:
KalmanFilterExample.c/h
Octave GNU file: KalmanFilterExampleSupport.m
The file is supported all plots of the article, generates the test signal file / array for the C code and calculates the Kalman filter.
%*********************************************************************/
% Freeware Demo SW from the www.dsp-weimich.com */
% Version 1.0 */
% KalmanFilterExampleSupport.m */
% Octave Script */
% High-level interactive language for numerical computations */
% Support the Kalman Filter with Example article */
%*********************************************************************/
Simple Scalar Kalman Filter. C Implementation Using the Octave GNU Tool
The C Code:
SimpleKalmanFilter.c/h
Octave GNU file: SimpleKalmanFilterSupport.m
The file is supported all plots of the article, generates the test signal file / array for the C code and calculates the Scalar Kalman filter.
%*********************************************************************/
% Freeware Demo SW from the www.dsp-weimich.com */
% Version 1.0 */
% SimpleKalmanFilterSupport.m */
% Octave Script */
% High-level interactive language for numerical computations */
% Support the Simple Scalar Kalman Filter article */
%*********************************************************************/
Bluestein’s Algorithm or Fourier Transform as Linear Chirp FIR Filter. C Implementation Using the Octave GNU Tool
The C Code:
Bluestein_float.c/h
Octave GNU file: Bluestein_Support.m
The file is supported analysis, tests, generation for the C code.
%*********************************************************************/
% Freeware Demo SW from the www.dsp-weimich.com */
% Version 1.0 */
% Bluestein_Support.m */
% Octave Script */
% High-level interactive language for numerical computations */
% Support the Bluestein’s Algorithm article */
%*********************************************************************/
Cyclic Redundancy Check (CRC): bitwise, lookup table, fast crc without lookup table, reversing crc. C Implementation Using the Octave GNU Tool
The C Code:
crc_x16_x2_x_1.c/h
crc_x16_x12_x5_1.c/h
crc32_0x04C11DB7.c/h
crc_x64_x4_x3_x_1.c/h
reverse_crc_x16_x2_x_1.c/h
Octave GNU file: CRC_support.m
The file is supported generation lookup tables for the C code.
%*********************************************************************/
% Freeware Demo SW from the www.dsp-weimich.com */
% Version 1.0 */
% CRC_support.m */
% Octave Script */
% High-level interactive language for numerical computations */
% Support the article: Cyclic Redundancy Check */
%*********************************************************************/
Functions Implementation: Square Root, Logarithm, Sine, Cosine, Arctangent. C Code and Octave Script
The C Code:
square_root.c/h
logarithm.c/h
sine.c/h
atan.c/h
Octave GNU file: FunctionsRealization.m
The file is supported analysis, plots, generation for the C code and test.
%*********************************************************************/
% Freeware Demo SW from the www.dsp-weimich.com */
% Version 1.0 */
% FunctionsRealization.m */
% Octave Script */
% High-level interactive language for numerical computations */
% Support the article: Functions Implementation */
%*********************************************************************/
Simple Embedded Operating System and C Implementation
The C Code: SimpleOS.c/h
“Non-Causal“ Digital Chebyshev Filter with Linear Phase Response. C Implementation and Octave Script
The C Code: non_causal_filter_integer.c/h and non_causal_filter_float.c/h
Functions:
iir_non_causal_init( )
iir__non_causal_filter( )
Octave GNU file: DigitalChebyshevFilter.m
The file is supported plots, generation for the C code and test.
%*********************************************************************/
% Freeware Demo SW from the www.dsp-weimich.com */
% Version 1.0 */
% DigitalChebyshevFilter.m */
% Octave Script */
% High-level interactive language for numerical computations */
% Support the article: */
% Digital Chebyshev Filter with Linear Phase Response */
%*********************************************************************/
Goertzel Algorithm and C Implementation Using the Octave GNU Tool
The C Code: GoertzelFilter.c/h
Functions:
int_goertzel_algorithm( )
flt_goertzel_algorithm( )
and so on
Octave GNU file: Goertzel_Filter.m
The file is supported plots, generation for the C code and test.
%*********************************************************************/
% Freeware Demo SW from the www.dsp-weimich.com */
% Version 1.0 */
% Goertzel_Filter.m */
% Octave Script */
% High-level interactive language for numerical computations */
% Support the article: Goertzel filter */
%*********************************************************************/
Fast Fourier Transform (FFT) and C Implementation Using the Octave GNU Tool
The C Code: fft_float.c/h, fft_integer.c/h
Functions:
fft_decimation_in_time( )
fft_decimation_in_frequency( )
and so on
Octave GNU file: FFT_Support.m
The file is supported arrays generation for the C code and test.
%*********************************************************************/
% Freeware Demo SW from the www.dsp-weimich.com */
% Version 1.0 */
% FFT_Support.m */
% Octave Script */
% High-level interactive language for numerical computations */
% Support the FFT article */
%*********************************************************************/
Digital Slew Rate Limiter Filter and C Implementation
The C Code: SlewRateLimiterFilter.c/h
SRLF Functions:
void srl_filter_init(sint16 init_value);
where init_value – start output y(0) initialization
sint16 srl_filter(sint16 x_input);
where x_input – filter x(n) input
return – filter y(n) output
Slow SRLF Functions. Variant 1:
void slow_v1_srl_filter_init(sint16 init_value);
where init_value – start output y(0) initialization
sint16 slow_v1_srl_filter(sint16 x_input);
where x_input – filter x(n) input
return – filter y(n) output
Slow SRLF Functions. Variant 2:
void slow_v2_srl_filter_init(sint16 init_value);
where init_value – start output y(0) initialization
sint16 slow_v2_srl_filter(sint16 x_input);
where x_input – filter x(n) input
return – filter y(n) output
Matched Filter Using Octave GNU Tool
Octave GNU file matched_filter.m
You can see in the file all calculations and all graphics for the article.
%*********************************************************************/
% Freeware Demo SW from the www.dsp-weimich.com */
% Version 1.0 */
% Matched_Filter.m */
% Octave Script */
% High-level interactive language for numerical computations */
% Support the article: Matched filters */
%*********************************************************************/
Median Filter and C Implementation
C-source code median_filter.c/h
Functions:
sint16 ClassicMedianFilter(sint16* ptrArray, uint16 arraySize); – classic median filter
sint16 AdvanceMedianFilter(sint16* ptrArray, uint16 arraySize); – modification of the median filter
where
ptrArray – pointer on the input data
arraySize – input data length
return value is filter output
IIR Filter and C Implementation Using Octave GNU Tool
iir_filter_integer.c/h – the IIR filter with the fixed point arithmetic
iir_filter_float.c/h – the IIR filter with the float arithmetic
Functions:
– Form I
void iir_form_I_initialization(void); – clear the filter history (working arrays)
sint16 iir_form_I(sint16 x_input); – calculate the IIR filter: x_input – input, return value is filter output
– Form II
void iir_form_II_initialization(void); – clear the filter history (working arrays)
sint16 iir_form_II(sint16 x_input); – calculate the IIR filter: x_input – input, return value is filter output
– Transposed Form II
void iir_transposed_form_II_initialization(void); – clear the filter history (working arrays)
sint16 iir_transposed_form_II(sint16 x_input); – calculate the IIR filter: x_input – input, return value is filter output
Octave GNU file IIR_Filter.m – analysis and plot
%*********************************************************************/
% Freeware Demo SW from the www.dsp-weimich.com */
% Version 1.0 */
% IIR_Filter.m */
% Octave Script */
% High-level interactive language for numerical computations */
% Support the article: IIR Filter */
%*********************************************************************/
FIR Filter Implementation Using Octave GNU Tool and C Language
fir_filter.c/h with the functions:
void fir_filter_initialization(void) – initialize / clear the filter history (x(n-1),…x(n-N+1))
sint16 fir_filter_float(sint16 x_input) – calculate the output signal y(n) using the input signal x(n)=x_input. The function is used the float FIR coefficients
sint16 fir_filter_integer(sint16 x_input) – calculate the output signal y(n) using the input signal x(n)=x_input. The function is used the integer FIR coefficients
The Octave GNU file: Fir_Filter.m – analysis and plot
%*********************************************************************/
% Freeware Demo SW from the www.dsp-weimich.com */
% Version 1.0 */
% FIR_Filter.m */
% Octave Script */
% High-level interactive language for numerical computations */
% Support the article: FIR filters */
%*********************************************************************/
Overview of Sorts with C Source Code
sorts.c/h with the functions:
void BubbleSortMethod(sint16*, uint16); – Bubble Sort
void InsertionSortMethod(sint16*, uint16); – Insertion Sort
void InsertionLinkSortMethod(sint16*, uint16*, uint16); – Insertion Sort using Link
void ShellSortMethod(sint16*, uint16, uint16); – Shell Sort
void QuickSortMethod(sint16*, uint16); – Quick Sort
void HeapSortMethod(sint16*, uint16); – Heap Sort
Bessel Filter in Digital Form?
The Octave GNU file: DigitalBesselFilter.m has all calculations for the article. You can test self the different variants.
%*********************************************************************/
% Freeware Demo SW from the www.dsp-weimich.com */
% DigitalBesselFilter.m */
% Octave Script */
% High-level interactive language for numerical computations*/
% Support the article: Bessel Filter in Digatal Form? */
%*********************************************************************/
Simple Low Pass IIR Filter Implementation Using the C Language
IIRfirstOrderFixedPoint.c/h – implementation with single multiplication and fixed point arithmetic
IIRfirstOrderFloat.c/h – implementation with single multiplication and float point arithmetic
IIRfirstOrderShift.c/h – implementation with shift operation instead of multiplication and fixed point arithmetic