maddyblue / go-dsp

Digital Signal Processing for Go
http://godoc.org/github.com/mjibson/go-dsp
ISC License
847 stars 89 forks source link

Add Blackman-Harris window function and create go.mod file #27

Open rohansatapathy opened 9 months ago

rohansatapathy commented 9 months ago

I added a function for a Blackman-Harris window to the window package as well as the relevant tests. I ran into an issue using go test to run window_test.go, so I ran go mod init && go mod tidy in the root directory to add a go.mod file.

Currently go test will fail for a 10-point Blackman-Harris window because I didn't add enough digits to the test case in window_test.go, and I'm not sure how to get more precision from Matlab at the moment. However, I implemented the function exactly as it appears in https://www.mathworks.com/help/signal/ref/blackmanharris.html so I'm confident it's doing the correct calculations.