Time Frequency Transform for Chirp Signals
Step 1: Quadratic chirp signal
Generate a quadratic chirp signal from 10 Hz to 120 Hz in 1 second with 10,000 sampling points.
import numpy as np
import scipy
import matplotlib.pyplot as plt
# Generate a quadratic chirp signal
dt = 0.0001
rate = int(1/dt)
ts = np.linspace(0, 1, int(1/dt))
data = scipy.signal.chirp(ts, 10, 1, 120, method='quadratic')
Step 2: S Transform Spectrogram
from s import *
# Compute S Transform Spectrogram
spectrogram = sTransform(data, sample_rate=rate)
plt.imshow(abs(spectrogram), origin='lower', aspect='auto')
plt.title('Original Spectrogram')
plt.show()
Step 3: Quick recovery of full ts from S transform * 0 frequency row*
(This recovered ts is computed based on the fact that the 0 frequency row always contain the full FFT result of the ts in this program by design.)
# Quick Recovery of ts from S Transform 0 frequency row
recovered_ts = recoverS(spectrogram)
plt.plot(recovered_ts-data)
plt.title('Time Series Reconstruction Error')
plt.show()
Step 4: Recovered spectrogram:
# Compute S Transform Spectrogram on the recovered time series
recoveredSpectrogram = sTransform(recovered_ts, sample_rate=rate, frange=[0,500])
plt.imshow(abs(recoveredSpectrogram), origin='lower', aspect='auto')
plt.title('Recovered Specctrogram')
plt.show()
Step 5: The real inverse S transform
# Quick Inverse of ts from S Transform
inverse_ts, inverse_tsFFT = inverseS(spectrogram)
plt.plot(inverse_ts)
plt.plot(inverse_ts-data)
plt.title('Time Series Reconstruction Error')
plt.legend(['Recovered ts', 'Error'])
plt.show()
Step 6: Recovered spectrogram on the real inverse S transform ts
# Compute S Transform Spectrogram on the recovered time series
inverseSpectrogram = sTransform(inverse_ts, sample_rate=rate, frange=[0,500])
plt.imshow(abs(inverseSpectrogram), origin='lower', aspect='auto')
plt.title('Recovered Specctrogram')
plt.show()
Metadata
Release files for TFchirp 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| TFchirp-0.0.2.tar.gz | 3.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| TFchirp-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.4 kB
Release files / TFchirp-0.0.2.tar.gz
| Download URL | TFchirp-0.0.2.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
99a4d2499bdcebbd50ee262922d87fb0d72dfc31468e9d15d57301bd86510611
|
|
BLAKE2b-256 checksum How to use checksums |
28207ce0396f89abb229938b904ffd66cd0880b80043182305074a72b3edeeb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.7.1 pkginfo/1.6.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.1
|
Release files / TFchirp-0.0.2-py3-none-any.whl
| Download URL | TFchirp-0.0.2-py3-none-any.whl |
|---|---|
| Size | 15.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
edc11c62b2b1536130271e76fe32360269a34691dcc7a811d2fd23985447c3ab
|
|
BLAKE2b-256 checksum How to use checksums |
a0862ab130d0841313fe27202bb7940d4093311e66f362c06251b2b605d84c9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.7.1 pkginfo/1.6.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.9.1
|
Security for TFchirp 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.