psambit9791 / jdsp

A Java Library for Digital Signal Processing
https://jdsp.dev
MIT License
240 stars 45 forks source link

Decimate incorrect for nondivisible factors #1

Closed psambit9791 closed 4 years ago

psambit9791 commented 4 years ago

Problems occurring for values of factors for which the sampling frequency is not divisible by the factor. Array length is less by 1.

OUTPUT:

array lengths differed, expected.length=32 actual.length=31; arrays first differed at element [31]; Expected :-0.494 Actual :end of array

at com.onyx.jdsp.TestDecimate.DecimateWithZeroPhaseTest(TestDecimate.java:102) Caused by: java.lang.AssertionError: expected:<-0.494> but was: at org.junit.Assert.failNotEquals(Assert.java:835)

psambit9791 commented 4 years ago

Resolved by changing the length of the output array in Decimate class.