I am trying to figure out how to use the matlab gausswin function which constructs a Gaussian window for $N$ samples with a given standard deviation $\sigma$. The function is defined by

w = gausswin(N, alpha)

where alpha is $1/\sigma$. I would like my Gaussian window to contain $\pm 3 \sigma$ in the Gaussian. So for $N$ samples it seems I should do: $6 \sigma = N$ or $\sigma = N/6$. However, here are the results for $N = 100$ and $\sigma = 100/6 \approx 16.666$: Gaussian window from matlab Clearly this Gaussian does not extend to $\pm 3 \sigma$. Can someone tell me what I'm doing wrong?

My guess it is has something to do with some length scale which isn't being properly specified. It seems to me that the alpha input to the gausswin function is some kind of normalized (unitless) standard deviation. Perhaps I'm not accounting for that.


1 Answer 1


The manual entry does not say that $\alpha = 1/\sigma$. It says $\alpha$ is proportional to the inverse of $\sigma$.

If you look at the example on that page you'll see

stdev = (N-1)/(2*alpha);

which, for your values says

stdev = (100-1)/(2*16.6667) = 825

you should be scaling the relationship by $N-1$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.