all: run gofmt and generate all packages

Changes made in dsp/fourier/internal/fftpack break the formatting used
there, so these are reverted. There will be complaints in CI.

[git-generate]
gofmt -w .
go generate gonum.org/v1/gonum/blas
go generate gonum.org/v1/gonum/blas/gonum
go generate gonum.org/v1/gonum/unit
go generate gonum.org/v1/gonum/unit/constant
go generate gonum.org/v1/gonum/graph/formats/dot
go generate gonum.org/v1/gonum/graph/formats/rdf
go generate gonum.org/v1/gonum/stat/card

git checkout -- dsp/fourier/internal/fftpack
This commit is contained in:
Dan Kortschak
2022-08-05 20:57:59 +09:30
parent fee5019b48
commit 5f0141ca4c
308 changed files with 5004 additions and 3064 deletions

View File

@@ -16,7 +16,9 @@ import "math"
// limited length sequence of values without any modification.
//
// The sequence weights are
// w[k] = 1,
//
// w[k] = 1,
//
// for k=0,1,...,N-1 where N is the length of the window.
//
// Spectral leakage parameters: ΔF_0 = 2, ΔF_0.5 = 0.89, K = 1, ɣ_max = -13, β = 0.
@@ -32,7 +34,9 @@ func RectangularComplex(seq []complex128) []complex128 {
// Sine window is a high-resolution window.
//
// The sequence weights are
// w[k] = sin(π*k/(N-1)),
//
// w[k] = sin(π*k/(N-1)),
//
// for k=0,1,...,N-1 where N is the length of the window.
//
// Spectral leakage parameters: ΔF_0 = 3, ΔF_0.5 = 1.23, K = 1.5, ɣ_max = -23, β = -3.93.
@@ -53,7 +57,9 @@ func SineComplex(seq []complex128) []complex128 {
// The Lanczos window is a high-resolution window.
//
// The sequence weights are
// w[k] = sinc(2*k/(N-1) - 1),
//
// w[k] = sinc(2*k/(N-1) - 1),
//
// for k=0,1,...,N-1 where N is the length of the window.
//
// Spectral leakage parameters: ΔF_0 = 3.24, ΔF_0.5 = 1.3, K = 1.62, ɣ_max = -26.4, β = -4.6.
@@ -79,7 +85,9 @@ func LanczosComplex(seq []complex128) []complex128 {
// The Triangular window is a high-resolution window.
//
// The sequence weights are
// w[k] = 1 - |k/A -1|, A=(N-1)/2,
//
// w[k] = 1 - |k/A -1|, A=(N-1)/2,
//
// for k=0,1,...,N-1 where N is the length of the window.
//
// Spectral leakage parameters: ΔF_0 = 4, ΔF_0.5 = 1.33, K = 2, ɣ_max = -26.5, β = -6.
@@ -99,7 +107,9 @@ func TriangularComplex(seq []complex128) []complex128 {
// The Hann window is a high-resolution window.
//
// The sequence weights are
// w[k] = 0.5*(1 - cos(2*π*k/(N-1))),
//
// w[k] = 0.5*(1 - cos(2*π*k/(N-1))),
//
// for k=0,1,...,N-1 where N is the length of the window.
//
// Spectral leakage parameters: ΔF_0 = 4, ΔF_0.5 = 1.5, K = 2, ɣ_max = -31.5, β = -6.
@@ -120,7 +130,9 @@ func HannComplex(seq []complex128) []complex128 {
// The Bartlett-Hann window is a high-resolution window.
//
// The sequence weights are
// w[k] = 0.62 - 0.48*|k/(N-1)-0.5| - 0.38*cos(2*π*k/(N-1)),
//
// w[k] = 0.62 - 0.48*|k/(N-1)-0.5| - 0.38*cos(2*π*k/(N-1)),
//
// for k=0,1,...,N-1 where N is the length of the window.
//
// Spectral leakage parameters: ΔF_0 = 4, ΔF_0.5 = 1.45, K = 2, ɣ_max = -35.9, β = -6.
@@ -148,7 +160,9 @@ func BartlettHannComplex(seq []complex128) []complex128 {
// the highest ɣ_max.
//
// The sequence weights are
// w[k] = 25/46 - 21/46 * cos(2*π*k/(N-1)),
//
// w[k] = 25/46 - 21/46 * cos(2*π*k/(N-1)),
//
// for k=0,1,...,N-1 where N is the length of the window.
//
// Spectral leakage parameters: ΔF_0 = 4, ΔF_0.5 = 1.33, K = 2, ɣ_max = -42, β = -5.37.
@@ -174,7 +188,9 @@ func HammingComplex(seq []complex128) []complex128 {
// The Blackman window is a high-resolution window.
//
// The sequence weights are
// w[k] = 0.42 - 0.5*cos(2*π*k/(N-1)) + 0.08*cos(4*π*k/(N-1)),
//
// w[k] = 0.42 - 0.5*cos(2*π*k/(N-1)) + 0.08*cos(4*π*k/(N-1)),
//
// for k=0,1,...,N-1 where N is the length of the window.
//
// Spectral leakage parameters: ΔF_0 = 6, ΔF_0.5 = 1.7, K = 3, ɣ_max = -58, β = -7.54.
@@ -202,8 +218,10 @@ func BlackmanComplex(seq []complex128) []complex128 {
// The Blackman-Harris window is a low-resolution window.
//
// The sequence weights are
// w[k] = 0.35875 - 0.48829*cos(2*π*k/(N-1)) +
// 0.14128*cos(4*π*k/(N-1)) - 0.01168*cos(6*π*k/(N-1)),
//
// w[k] = 0.35875 - 0.48829*cos(2*π*k/(N-1)) +
// 0.14128*cos(4*π*k/(N-1)) - 0.01168*cos(6*π*k/(N-1)),
//
// for k=0,1,...,N-1 where N is the length of the window.
//
// Spectral leakage parameters: ΔF_0 = 8, ΔF_0.5 = 1.97, K = 4, ɣ_max = -92, β = -8.91.
@@ -232,8 +250,10 @@ func BlackmanHarrisComplex(seq []complex128) []complex128 {
// The Nuttall window is a low-resolution window.
//
// The sequence weights are
// w[k] = 0.355768 - 0.487396*cos(2*π*k/(N-1)) + 0.144232*cos(4*π*k/(N-1)) -
// 0.012604*cos(6*π*k/(N-1)),
//
// w[k] = 0.355768 - 0.487396*cos(2*π*k/(N-1)) + 0.144232*cos(4*π*k/(N-1)) -
// 0.012604*cos(6*π*k/(N-1)),
//
// for k=0,1,...,N-1 where N is the length of the window.
//
// Spectral leakage parameters: ΔF_0 = 8, ΔF_0.5 = 1.98, K = 4, ɣ_max = -93, β = -9.
@@ -262,8 +282,10 @@ func NuttallComplex(seq []complex128) []complex128 {
// The Blackman-Nuttall window is a low-resolution window.
//
// The sequence weights are
// w[k] = 0.3635819 - 0.4891775*cos(2*π*k/(N-1)) + 0.1365995*cos(4*π*k/(N-1)) -
// 0.0106411*cos(6*π*k/(N-1)),
//
// w[k] = 0.3635819 - 0.4891775*cos(2*π*k/(N-1)) + 0.1365995*cos(4*π*k/(N-1)) -
// 0.0106411*cos(6*π*k/(N-1)),
//
// for k=0,1,...,N-1 where N is the length of the window.
//
// Spectral leakage parameters: ΔF_0 = 8, ΔF_0.5 = 1.94, K = 4, ɣ_max = -98, β = -8.8.
@@ -292,9 +314,11 @@ func BlackmanNuttallComplex(seq []complex128) []complex128 {
// The Flat Top window is a low-resolution window.
//
// The sequence weights are
// w[k] = 0.21557895 - 0.41663158*cos(2*π*k/(N-1)) +
// 0.277263158*cos(4*π*k/(N-1)) - 0.083578947*cos(6*π*k/(N-1)) +
// 0.006947368*cos(4*π*k/(N-1)),
//
// w[k] = 0.21557895 - 0.41663158*cos(2*π*k/(N-1)) +
// 0.277263158*cos(4*π*k/(N-1)) - 0.083578947*cos(6*π*k/(N-1)) +
// 0.006947368*cos(4*π*k/(N-1)),
//
// for k=0,1,...,N-1 where N is the length of the window.
//
// Spectral leakage parameters: ΔF_0 = 10, ΔF_0.5 = 3.72, K = 5, ɣ_max = -93.0, β = -13.34.