Main Content

filter (Galois field)

R2026b

1-D digital filter over Galois field

Description

y = filter(b,a,x) filters the data in the vector x with the filter described by numerator coefficient vector b and denominator coefficient vector a. The vectors b, a, and x must be Galois vectors in the same field. If a(1) is not equal to 1, then filter normalizes the filter coefficients by a(1). As a result, a(1) must be nonzero. For filter implementation information, see Direct Form II Transposed Filter.

example

[y,zf] = filter(b,a,x) returns the final conditions of the filter delays in the Galois vector zf. The length of the vector zf is max(size(a),size(b))-1.

Examples

collapse all

When using the Galois 1-D digital filter function, the data is normalized by the first element of the denominator coefficient vector.

a = gf([2 3 5 7],3);
b = gf([1 3],3);
x = gf(randi([0,7],10,1),3);
filt_x = filter(b,a,x)
 
filt_x = GF(2^3) array. Primitive polynomial = D^3+D+1 (11 decimal)
 
Array elements = 
 
   6
   6
   3
   4
   7
   4
   2
   2
   0
   5

The first coefficient of the denominator coefficient vector, a(1) = 2. To confirm the function normalizes the data, manually normalize the filtered data. Use isequal to compare the outputs. We see they are equal.

filt_x2 = a(1) * filter(b/a(1),a,x)
 
filt_x2 = GF(2^3) array. Primitive polynomial = D^3+D+1 (11 decimal)
 
Array elements = 
 
   6
   6
   3
   4
   7
   4
   2
   2
   0
   5
isequal(filt_x,filt_x2)
ans = logical
   1

Input Arguments

collapse all

Numerator coefficients of the filter, specified as a row vector or a column vector.

Data Types: double

Denominator coefficients of the filter, specified as a row vector or a column vector.

Data Types: double

Input data to be filtered, specified as a row vector or a column vector.

Data Types: double

Output Arguments

collapse all

Filtered output data, returned as a row vector of the polynomial coefficients in order of ascending powers.

Final conditions of the filter delays in the Galois vector, returned as a row vector of the polynomial coefficients in order of ascending powers.

More About

collapse all

Version History

Introduced before R2006a

See Also