Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

specgram(x) should warn if x.size < 256 #6064

Copy link
Copy link
Closed
@roger-

Description

@roger-
Issue body actions

The default NFFT size of 256 gives misleading results if x.size << 256, for example this chirp:

import numpy as np
import pylab as pyl
from scipy.signal import chirp

fs = 200
t = np.arange(0, 1, 1/fs)

signal = chirp(t, t1=1, f0=0, f1=100)

pyl.specgram(signal, Fs=fs)
pyl.show()

Gives this. Passing NFFT=32, noverlap=16 to specgram() gives this more reasonable result.

Simplest fix is probably just to warn users when their data is too small.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.