Skip to content

Commit

Permalink
Merge pull request #21 from wsc1/master
Browse files Browse the repository at this point in the history
NewSHalfComplex
  • Loading branch information
wsc1 authored Nov 9, 2018
2 parents f53f29b + de345a3 commit 819bb0c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fft/s.go
Original file line number Diff line number Diff line change
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 819bb0c

Please sign in to comment.