From 82f9dfbf20785e72e54d318f39d577f95367e39e Mon Sep 17 00:00:00 2001 From: Scott Date: Fri, 9 Nov 2018 16:30:13 +0100 Subject: [PATCH] add NewSHalfComplex --- fft/s.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fft/s.go b/fft/s.go index e809e22..d45982e 100644 --- a/fft/s.go +++ b/fft/s.go @@ -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 {