leiferlab / savitzkygolay

Savitzky-Golay filters
15 stars 7 forks source link

1D savgol test #4

Open nghorbani opened 1 month ago

nghorbani commented 1 month ago

Hi, I wrote a simple test and the output size is different ` input_arr = np.random.rand(10,1) output_arr = filter1D(input_arr.reshape(-1), mu=5, poly=3, order=0)

output_arr2 = savgol_filter(input_arr, 5, 3, axis=0, mode='wrap')

` resulting in output_arr of shape 10, and output_arr2 shape of 5. it has to do with conv(...,'full'). if "same" is used the dimension are correct but still the values are different

nghorbani commented 1 month ago

image wierd is that they sometimes (at certain input values) come very close

nghorbani commented 1 month ago

the 3D filter looks meaningful

input_arr = np.random.rand(10,1,3) # (100,1,3) print(f"Input array: {input_arr.shape}") output_arr = filter3D(input_arr, mu=7, poly=5, order=0) # (100,1,3) plot_3d(input_arr, output_arr)

Figure_1