Skip to content

Commit

Permalink
use math.Pi
Browse files Browse the repository at this point in the history
  • Loading branch information
schollz committed Jul 31, 2023
1 parent 6939ecd commit 1ce2f76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/gno.land/p/demo/audio/biquad/biquad.gno
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Filter struct {
// filterType: string that specifies the type of filter (currently only 'highpass' or 'lowpass')
// Outputs: a filter object
func New(fc float64, fs float64, q float64, db float64, filterType string) *Filter {
w0 := 2 * 3.1415926535897932384626 * (fc / fs)
w0 := 2 * math.Pi * (fc / fs)
cosW := math.Cos(w0)
sinW := math.Sin(w0)
A := 1.0 // db = 0
Expand All @@ -37,11 +37,11 @@ func New(fc float64, fs float64, q float64, db float64, filterType string) *Filt
a0 := 1 + alpha
a1 := -2 * cosW
a2 := 1 - alpha
if filter_type == "highpass" {
if filterType == "highpass" {
b0 = (1 + cosW) / 2
b1 = -(1 + cosW)
b2 = (1 + cosW) / 2
} else if filter_type == "lowpass" {
} else if filterType == "lowpass" {
// do nothing, default
}

Expand Down

0 comments on commit 1ce2f76

Please sign in to comment.