scipy/scipy — pull request #3433 by ankit-maverick (2014-03-06 01:05:32+00:00)
Title: Correcting the normalization of chebwin window function

I was trying to work on https://github.com/scipy/scipy/issues/2221 but noticed that the current normalization for Chebwin window function works correctly only for significant attenuation :
##### Current :
```
In [3]: chebwin(6, 10)
Out[3]:
array([ 1.46877571, 0.89172335, 1. , 1. , 0.89172335,
1.46877571])

In [4]: chebwin(6, 20)
Out[4]:
array([ 0.54057352, 0.77676753, 1. , 1. , 0.77676753,
0.54057352])
```
In the case of 10dB attenuation, chebwin is not correctly normalized. The tests missed this because they were on 40dB(significant) attenuation.

##### This PR :
```
In [2]: chebwin(6, 10)
Out[2]: array([ 1. , 0.60712017, 0.68083915, 0.68083915, 0.60712017, 1. ])

In [3]: chebwin(6, 20)
Out[3]:
array([ 0.54057352, 0.77676753, 1. , 1. , 0.77676753,
0.54057352])
```

The results are in tune with Octave and Matlab.

##### Octave :
```
octave:8> chebwin(6, 10)
ans =

1.00000
0.60712
0.68084
0.68084
0.60712
1.00000

octave:9> chebwin(6, 20)
ans =

0.54057
0.77677
1.00000
1.00000
0.77677
0.54057

```
##### Matlab :
```
>> chebwin(6, 10)

ans =

1.0000
0.6071
0.6808
0.6808
0.6071
1.0000

>> chebwin(6, 20)

ans =

0.5406
0.7768
1.0000
1.0000
0.7768
0.5406
```
The previous tests missed this because it did not cover a low attenuation case.