<p dir="auto">As mentioned in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="7725438" data-permission-text="Title is private" data-url="https://github.com/numpy/numpy/issues/1177" data-hovercard-type="issue" data-hovercard-url="/numpy/numpy/issues/1177/hovercard" href="https://github.com/numpy/numpy/issues/1177">numpy/numpy/issues/1177</a>, Chirp Z-transform and special cases of it have been submitted to SciPy under public domain by Paul Kienzle and Nadav Horesh:  <a href="https://mail.python.org/pipermail/scipy-user/2009-January/019530.html" rel="nofollow">[SciPy-user] Chirp Z transform</a></p>
<p dir="auto">The special cases of CZT are zoom FFT and "scaled FFT" (not sure what that does).  DFT is also a special case of CZT, so if you call <code class="notranslate">czt(data)</code> with the default options, it's an FFT, but faster for prime sizes because of Bluestein's algorithm, useful in <code class="notranslate">resample</code> for instance? (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="41809016" data-permission-text="Title is private" data-url="https://github.com/scipy/scipy/issues/3956" data-hovercard-type="pull_request" data-hovercard-url="/scipy/scipy/pull/3956/hovercard" href="https://github.com/scipy/scipy/pull/3956">#3956</a>):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="x = rand(42073) # prime length

allclose(czt(x), fft(x))
Out[37]: True

timeit czt(x)
10 loops, best of 3: 53.9 ms per loop

timeit fft(x)
1 loops, best of 3: 2.35 s per loop

2.35 / 53.9e-3 # speedup factor
Out[40]: 43.59925788497217"><pre class="notranslate"><code class="notranslate">x = rand(42073) # prime length

allclose(czt(x), fft(x))
Out[37]: True

timeit czt(x)
10 loops, best of 3: 53.9 ms per loop

timeit fft(x)
1 loops, best of 3: 2.35 s per loop

2.35 / 53.9e-3 # speedup factor
Out[40]: 43.59925788497217
</code></pre></div>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/stefanv/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/stefanv">@stefanv</a> said:</p>
<blockquote>
<p dir="auto">Thank you both for the contribution!  I've reviewed the code and think<br>
it should be included in SciPy.  Would someone else like to have a<br>
look before I commit it?</p>
<p dir="auto">Where would the best place for this be?  scipy.fftpack?</p>
</blockquote>
<p dir="auto">I think it makes sense to put it in scipy.fftpack, too, though that doesn't have any classes, just functions.  (Unless it should all be put in numpy, but I'm guessing zoom FFT is too specialized for that?)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; import numpy as np
&gt;&gt;&gt; from scipy import sparse
&gt;&gt;&gt; sparse.hstack( (sparse.csr_matrix([[1,2]]), np.array([[]])) )
Traceback (most recent call last):

  File &quot;&lt;ipython-input-27-f65b402ca75d&gt;&quot;, line 1, in &lt;module&gt;
    hstack( (csr_matrix([[1,2]]), np.array([[]])) )

  File &quot;C:\Python27\lib\site-packages\scipy\sparse\construct.py&quot;, line 423, in hstack
    return bmat([blocks], format=format, dtype=dtype)

  File &quot;C:\Python27\lib\site-packages\scipy\sparse\construct.py&quot;, line 535, in bmat
    raise ValueError('blocks[:,%d] is all None' % bcol_lengths.argmin())

ValueError: blocks[:,1] is all None"><pre class="notranslate"><code class="notranslate">&gt;&gt;&gt; import numpy as np
&gt;&gt;&gt; from scipy import sparse
&gt;&gt;&gt; sparse.hstack( (sparse.csr_matrix([[1,2]]), np.array([[]])) )
Traceback (most recent call last):

  File "&lt;ipython-input-27-f65b402ca75d&gt;", line 1, in &lt;module&gt;
    hstack( (csr_matrix([[1,2]]), np.array([[]])) )

  File "C:\Python27\lib\site-packages\scipy\sparse\construct.py", line 423, in hstack
    return bmat([blocks], format=format, dtype=dtype)

  File "C:\Python27\lib\site-packages\scipy\sparse\construct.py", line 535, in bmat
    raise ValueError('blocks[:,%d] is all None' % bcol_lengths.argmin())

ValueError: blocks[:,1] is all None
</code></pre></div>
<p dir="auto">The same error occurs with all sparse matrix formats and with vstack.</p>