mirror of
https://github.com/davrot/pytutorial.git
synced 2025-04-16 12:16:42 +02:00
Update README.md
Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
parent
d221db34f3
commit
ac3728064e
1 changed files with 19 additions and 2 deletions
|
@ -60,7 +60,7 @@ x = np.sin(t * f * 2 * np.pi)
|
|||
|
||||
plt.plot(t, x)
|
||||
plt.ylabel("sin(x)")
|
||||
plt.xlabel("sin(x)")
|
||||
plt.xlabel("t")
|
||||
plt.show()
|
||||
```
|
||||
|
||||
|
@ -88,12 +88,27 @@ f = [0, 1, ..., n/2-1, -n/2, ..., -1] / (d*n) if n is even
|
|||
f = [0, 1, ..., (n-1)/2, -(n-1)/2, ..., -1] / (d*n) if n is odd
|
||||
```
|
||||
|
||||
## [numpy.fft.rfftfreq](https://numpy.org/doc/stable/reference/generated/numpy.fft.rfftfreq.html#numpy-fft-rfftfreq)
|
||||
### [numpy.fft.rfftfreq](https://numpy.org/doc/stable/reference/generated/numpy.fft.rfftfreq.html#numpy-fft-rfftfreq)
|
||||
|
||||
```python
|
||||
fft.rfftfreq(n, d=1.0)
|
||||
```
|
||||
|
||||
### Comparison (cont.)
|
||||
|
||||
The frequency axes:
|
||||
|
||||
```python
|
||||
dt = t[1] - t[0]
|
||||
fft_freq = np.fft.fftfreq(x.shape[0],dt)
|
||||
print(fft_freq.shape) # -> (10000,)
|
||||
|
||||
rfft_freq = np.fft.rfftfreq(x.shape[0],dt)
|
||||
print(rfft_freq.shape) # -> (5001,)
|
||||
```
|
||||
|
||||
|
||||
|
||||
> Return the Discrete Fourier Transform sample frequencies (for usage with rfft, irfft).
|
||||
>
|
||||
> The returned float array f contains the frequency bin centers in cycles per unit of the sample spacing (with zero at the start). For instance, if the sample spacing is in seconds, then the frequency unit is cycles/second.
|
||||
|
@ -107,6 +122,8 @@ f = [0, 1, ..., (n-1)/2-1, (n-1)/2] / (d*n) if n is odd
|
|||
|
||||
> Unlike fftfreq (but like scipy.fftpack.rfftfreq) the Nyquist frequency component is considered to be positive.
|
||||
|
||||
|
||||
|
||||
## [Discrete Fourier Transform (numpy.fft)](https://numpy.org/doc/stable/reference/routines.fft.html#discrete-fourier-transform-numpy-fft)
|
||||
|
||||
## [Standard FFTs](https://numpy.org/doc/stable/reference/routines.fft.html#standard-ffts)
|
||||
|
|
Loading…
Add table
Reference in a new issue