Skip to content

Commit

Permalink
add NewSHalfComplex
Browse files Browse the repository at this point in the history
  • Loading branch information
wsc1 committed Nov 9, 2018
1 parent 3410739 commit 82f9dfb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fft/s.go
Expand Up @@ -54,6 +54,14 @@ func NewSN(n int) *S {
return &S{mags: mags, phases: phases, neg: neg, min: min, max: max}
}

// NewSHalfComplex creates a new spectrum object from a
// HalfComplex object.
func NewSHalfComplex(hc HalfComplex) *S {
s := NewSN(len(hc))
s.FromHalfComplex(hc)
return s
}

// At returns the complex representing the spectrum value at
// symmetric index i.
func (s *S) At(i int) complex128 {
Expand Down

0 comments on commit 82f9dfb

Please sign in to comment.