question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FFT - documentation - examples - linspace construction

See original GitHub issue

cf. https://docs.scipy.org/doc/scipy/reference/tutorial/fft.html

In the examples given in the documentation of FFT shouldn’t the linspace construction in

N = 600
# sample spacing
T = 1.0 / 800.0
x = np.linspace(0.0, N*T, N)

be x = np.linspace(0.0, (N-1)*T, N)

in order for the entries in x to have T spacing?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
peterbell10commented, Sep 24, 2020

The fft.html is generated from https://github.com/scipy/scipy/blob/master/doc/source/tutorial/fft.rst

That’s correct

I assume the PR has to be made from maintenance/1.5.x branch.

All PRs should be made against master. maintenance branches are only used for back-porting bug fixes.

I’ll also add that linspace(0.0, N*T, N, endpoint=False) might be a clearer way to write it.

1reaction
grlee77commented, Sep 24, 2020

Yes, the file to change is doc/source/tutorial/fft.rst. The PR should be made against the master branch. After merging a maintainer here can backport to 1.5.x as needed (not sure if there are currently plans for an additional 1.5.x release).

There are some contributor guidelines here, but much of the content may not be relevant for a simple documentation fix like this (i.e. no testing, benchmarks, etc. will be involved). There are also docs helping for working with Git.

The beginning sections of the Git docs above list how to create a fork of the SciPy repository and configure an “upstream” remote if you need help with that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

FFT-results in python dependend on linspace chosen?
You must calculate the correct frequencies depending on sample rate, number of samples and samples used in the fft (NFFT).
Read more >
Fourier Transforms With scipy.fft: Python Signal Processing
In this tutorial, you'll learn how to use the Fourier transform, a powerful tool for analyzing signals with applications ranging from audio processing...
Read more >
Understanding Fourier transform example in Matlab
Read up on the differences between the DFT (i.e., discrete fourier transform), the FFT (a fast version of DFT), the *Fourier Series and...
Read more >
Fast Fourier Transform with discrete data - MATLAB Answers
This calculates the Fourier transform, and displays a one-sided Fourier transform (0 Hz to the Nyquist frequency). This code subtracts the mean ...
Read more >
Fourier Transforms (scipy.fft) — SciPy v1.9.3 Manual
The example plots the FFT of the sum of two sines. ... Number of sample points >>> N = 600 >>> # sample...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found