package ru.r2cloud.jradio.blocks;

import org.junit.Test;

import ru.r2cloud.jradio.Context;
import ru.r2cloud.jradio.TestUtil;
import ru.r2cloud.jradio.source.InputStreamSource;

public class InterpFIRFilterTest {

	@Test
	public void test() throws Exception {
		Context ctx = new Context();
		ctx.setChannels(1);
		float[] taps = Firdes.gaussian(1.5, 2 * (32000f / 1200), 0.5, 12);
		try (InterpFIRFilter filter = new InterpFIRFilter(new InputStreamSource(InterpFIRFilterTest.class.getClassLoader().getResourceAsStream("polyphase.bin"), ctx), 2, taps)) {
			TestUtil.assertFloatInput("interpFirFilter.bin", filter);
		}
	}

}

@@ -209,16 +209,560 @@
 Test %7B%0A%0A
+%09@SuppressWarnings(%7B %22resource%22, %22unused%22 %7D)%0A%09@Test(expected = IllegalArgumentException.class)%0A%09public void testInvalidInterpolation() %7B%0A%09%09new InterpFIRFilter(null, 0, new float%5B%5D %7B 1.0f %7D);%0A%09%7D%0A%0A%09@SuppressWarnings(%7B %22resource%22, %22unused%22 %7D)%0A%09@Test(expected = IllegalArgumentException.class)%0A%09public void testInvalidTaps() %7B%0A%09%09new InterpFIRFilter(null, 1, new float%5B0%5D);%0A%09%7D%0A%0A%09@SuppressWarnings(%7B %22resource%22, %22unused%22 %7D)%0A%09@Test(expected = IllegalArgumentException.class)%0A%09public void testInvalidTaps2() %7B%0A%09%09new InterpFIRFilter(null, 1, null);%0A%09%7D%0A%0A
 %09@Test%0A%09

add some tests