Skip to content

Commit

Permalink
test resample with resample_filter
Browse files Browse the repository at this point in the history
  • Loading branch information
wheeheee committed Jan 24, 2025
1 parent 83528a0 commit 17a3568
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/resample.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ reference_vec(s) = vec(reference_data(s))
end

@testset "array signal" begin
x, mat, rate = rand(10_000), rand(121, 212), 1.23456789
h = resample_filter(rate)
# check that filtering with taps from `resample_filter` give equal results
@test resample(x, rate) == resample(x, rate, h)
@test resample(x, rate, 64, 0.8) == resample(x, rate, resample_filter(rate, 64, 0.8), 64)
@test resample(mat, rate; dims=1) == resample(mat, rate, h; dims=1)
@test resample(mat, rate; dims=2) == resample(mat, rate, h; dims=2)

rate = 1//2
x_ml = reference_vec("resample_x.txt")
h_ml = reference_vec("resample_taps_1_2.txt")
Expand Down

0 comments on commit 17a3568

Please # to comment.