Skip to content
Signal Processing

signal-processing-ai999x

Sampling, Fourier series and transforms, the DFT and FFT, filters, convolution, z-transforms, modulation, communication links, RF transmission lines and radar.

74capabilities
18topics
74formulas typeset
8worked examples below
1.0.0version
About this model

What Signal Processing does

Signal Processing (signal-processing-ai999x) is an offline Python package for signal processing. It covers sampling, Fourier series and transforms, the DFT and FFT, filters, convolution, z-transforms, modulation, communication links, RF transmission lines and radar.

It has 74 capabilities — 74 computational procedures — in 18 topics, the largest being Digital filters, Decibels and levels, Sampling and signal basics, Transmission lines, DFT and FFT and Digital communication. Ask a question in words with ask(), or call a capability by name with typed inputs with solve(). Every answer carries its value and unit, the steps that produced it and the formula in LaTeX.

When a question is not determined — a value is missing, an input is out of range, or the request is outside the package — it says so and names what it needs, instead of guessing. It runs on an ordinary CPU without a network connection (Python >=3.10), and the same question always gets the same answer.

Install

pip install signal-processing-ai999x
hf download AI999X/signal-processing-ai999x --local-dir signal-processing-ai999x

What it covers

Analog filters3Magnitude of an analog Butterworth low-pass response · Minimum order of a analog Butterworth filter · Minimum order of a analog Chebyshev type I filterAntennas1Gain of a parabolic dish (aperture) antennaCommunication links2Minimum SNR for a data rate (Shannon limit) · Shannon capacity of an AWGN channelConvolution and correlation3Circular (cyclic) convolution · Cross-correlation and the lag of its peak · Linear convolution of two sequencesDFT and FFT5DFT spectrum of a sequence (FFT) · Frequency of a DFT bin · Frequency resolution of an N-point DFT …Decibels and levels8Amplitude (voltage) ratio to decibels · Decibels to amplitude (voltage) ratio · Decibels to power ratio …Digital communication5Bit and symbol error rates of QPSK in AWGN · Bit error rate of BPSK (and coherent BFSK) in AWGN · Bit error rates of DPSK and noncoherent BFSK …Digital filters10Bilinear transform of a first-order low-pass filter · DC gain of a digital filter · FIR filter output …Filter design3Digital Butterworth filter design (bilinear transform) · FIR low-pass filter design by the window method · Second-order IIR notch filter designFourier series and transforms5Analytic signal, Hilbert transform and envelope · Fourier transform of a decaying exponential · Fourier transform of a rectangular pulse …Modulation3AM modulation index from the envelope · FM spectrum: Carson bandwidth and Bessel sideband amplitudes · Power in an AM (DSB full-carrier) signalNoise and link budgets3Free-space path loss · Noise figure of cascaded stages (Friis formula) · Received power of a radio link (Friis transmission equation)Radar3Doppler shift of a radar echo · Maximum detection range of a radar · Received echo power (radar range equation)Sampling and signal basics7Alias (apparent) frequency after sampling · Frequency and angular frequency from period · Mean, RMS, energy and average power of a sampled signal …Transmission lines6Characteristic impedance of a coaxial line · Input impedance of a terminated lossless line · Quarter-wave impedance transformer …Wavelets2Haar discrete wavelet transform · Inverse Haar wavelet transform (one level)Windows and spectral analysis3Coefficients of a window function · Main-lobe width of a spectral window · Periodogram (power spectral density estimate)Z-transform and stability2Poles and stability of a second-order all-pole system · Poles, zeros and stability of a digital filter
Try it

Worked examples

Each question below was put to signal-processing-ai999x and the answer shown is the one it returned, with the steps it took.

Sampling and signal basicsm.ask(…)

What is the Nyquist rate for a signal with a maximum frequency of 4 kHz?

fs_min = 8000 Hz
Ts_max = 0.000125 s
Show the steps
  1. Nyquist rate
    f_{s,\min} = 2 f_{\max}
    with fmax = 4 kHz
    → fs_min = 8000 Hz, Ts_max = 0.000125 s
Capability: Nyquist rate
DFT and FFTm.ask(…)

Compute the DFT of x = [1, 2, 3, 4].

peak_magnitude = 10
peak_bin = 0
magnitude = [10, 2.828427125, 2, 2.828427125]
phase = [0, 2.35619449, 3.141592654, -2.35619449]
real = [10, -2, -2, -2]
imag = [0, 2, 0, -2]
Show the steps
  1. DFT spectrum of a sequence (FFT)
    X[k] = \sum_{n=0}^{N-1} x[n]\,e^{-j2\pi kn/N},\ k = 0,\dots,N-1
    with x = [1, 2, 3, 4]
    → peak_magnitude = 10, peak_bin = 0, magnitude = [10, 2.828427125, 2, 2.828427125], phase = [0, 2.35619449, 3.141592654, -2.35619449], real = [10, -2, -2, -2], imag = [0, 2, 0, -2]
Digital communicationm.ask(…)

What is the bit error rate of BPSK at Eb/N0 = 8 dB?

ber = 0.0001909077741
ber_bfsk = 0.0060043864
Show the steps
  1. Bit error rate of BPSK (and coherent BFSK) in AWGN
    P_b = Q\!\left(\sqrt{2E_b/N_0}\right) = \tfrac12\,\mathrm{erfc}\sqrt{E_b/N_0}
    with ebn0_db = 8
    → ber = 0.0001909077741, ber_bfsk = 0.0060043864
Transmission linesm.ask(…)

A 50 ohm line is terminated in a load of 75 + j25 ohm. Find the reflection coefficient and the VSWR.

gamma_mag = 0.2773500981
gamma_angle_deg = 33.69006753
gamma_re = 0.2307692308
gamma_im = 0.1538461538
vswr = 1.767591879
return_loss_db = 11.13943352
Show the steps
  1. Reflection coefficient, VSWR and return loss of a load
    \Gamma = \frac{Z_L - Z_0}{Z_L + Z_0},\quad \mathrm{VSWR} = \frac{1 + |\Gamma|}{1 - |\Gamma|}
    with RL = 75 ohm, XL = 25 ohm, Z0 = 50 ohm
    → gamma_mag = 0.2773500981, gamma_angle_deg = 33.69006753, gamma_re = 0.2307692308, gamma_im = 0.1538461538, vswr = 1.767591879, return_loss_db = 11.13943352, mismatch_loss_db = 0.3476210626
Filter designm.solve(…)
m.solve("butterworth_design", N=2, fc="1 kHz", fs="8 kHz", btype="lowpass")
b = [0.09763107294, 0.1952621459, 0.09763107294]
a = [1, -0.9428090416, 0.3333333333]
Show the steps
  1. Digital Butterworth filter design (bilinear transform)
    s = 2f_s\frac{1 - z^{-1}}{1 + z^{-1}},\quad \omega_c = 2f_s\tan\frac{\pi f_c}{f_s}
    with N = 2, fc = 1 kHz, fs = 8 kHz, btype = lowpass
    → b = [0.09763107294, 0.1952621459, 0.09763107294], a = [1, -0.9428090416, 0.3333333333]
Analog filtersm.ask(…)

What is the magnitude response of a 4th-order Butterworth low-pass filter with a cutoff frequency of 1 kHz at 2 kHz?

magnitude = 0.06237828616
attenuation_db = 24.09933123
Show the steps
  1. Magnitude of an analog Butterworth low-pass response
    |H(f)| = \frac{1}{\sqrt{1 + (f/f_c)^{2N}}}
    with N = 4, fc = 1 kHz, f = 2 kHz
    → magnitude = 0.06237828616, attenuation_db = 24.09933123
Antennasm.ask(…)

What is the gain of a parabolic dish with a diameter of 3 m at 10 GHz and an aperture efficiency of 55%?

G_dbi = 47.35263538
G = 54358.00866
Ae = 3.887720909 m^2
Show the steps
  1. Gain of a parabolic dish (aperture) antenna
    G = \eta\left(\frac{\pi D}{\lambda}\right)^2
    with D = 3 m, f = 10 GHz, eta = 0.55
    → G_dbi = 47.35263538, G = 54358.00866, Ae = 3.887720909 m^2
Communication linksm.ask(…)

What is the Shannon capacity of a 3 kHz channel with an SNR of 30 dB?

C = 29901.67878
efficiency = 9.967226259
Show the steps
  1. Shannon capacity of an AWGN channel
    C = B\log_2(1 + \mathrm{SNR})
    with B = 3 kHz, snr_db = 30
    → C = 29901.67878, efficiency = 9.967226259
Use it

From Python or the command line

Every snippet was run as shown; the output under it is what it printed.

import signal_processing_ai999x as m

a = m.ask("What is the Nyquist rate for a signal with a maximum frequency of 4 kHz?")
print(a.outcome)
print(a.values)
for step in a.steps:
    print(step["name"])
Output
SOLVED
{'fs_min': 8000.0, 'Ts_max': 0.000125}
Nyquist rate
Figures

Computed, not drawn by hand

Every value in these figures was computed by the package, each point a run of solve(); in a notebook, plot() and plot_relation() draw a capability's curves the same way.

DFT magnitude spectrum of a two-tone signal

X[k] = \sum_{n=0}^{N-1} x[n]\,e^{-j2\pi kn/N},\ k = 0,\dots,N-1
DFT magnitude spectrum of a two-tone signalMagnitude of the 32-point DFT returned by the package for x[n] = sin(2π·3n/32) + 0.5 sin(2π·7n/32), n = 0…31 (bins 0–16 shown; the rest mirror them). The two tones appear at bins 3 and 7; marked: |X[3]| = 16, |X[7]| = 8.051015051015k = 3: 16k = 7: 8k — frequency bin (cycles per 32 samples)|X[k]|
Magnitude of the 32-point DFT returned by the package for x[n] = sin(2π·3n/32) + 0.5 sin(2π·7n/32), n = 0…31 (bins 0–16 shown; the rest mirror them). The two tones appear at bins 3 and 7; marked: |X[3]| = 16, |X[7]| = 8.

Butterworth low-pass responses of four orders

|H(f)| = \frac{1}{\sqrt{1 + (f/f_c)^{2N}}}
Butterworth low-pass responses of four ordersGain of Butterworth low-pass filters of order N = 1, 2, 4 and 8 with cutoff fc = 1000 Hz (each curve 81 frequencies computed by the package, 0.1 fc to 10 fc on a log axis); every order is 3 dB down at fc and falls by 20N dB per decade. Marked: f = 2000 Hz, N = 4, gain = −24.0993 dB.100100010000-150-100-500fc = 1000 Hz−24.0993 dBN = 1N = 2N = 4N = 8f — frequency [Hz]gain [dB]
Gain of Butterworth low-pass filters of order N = 1, 2, 4 and 8 with cutoff fc = 1000 Hz (each curve 81 frequencies computed by the package, 0.1 fc to 10 fc on a log axis); every order is 3 dB down at fc and falls by 20N dB per decade. Marked: f = 2000 Hz, N = 4, gain = −24.0993 dB.

A designed digital filter: impulse and step response

s = 2f_s\frac{1 - z^{-1}}{1 + z^{-1}},\quad \omega_c = 2f_s\tan\frac{\pi f_c}{f_s}
A designed digital filter: impulse and step responseImpulse response (stems) and step response (line) of the order-4 Butterworth low-pass filter designed by the package for fc = 1000 Hz at fs = 8000 Hz (b = [0.01021, 0.04084, 0.06126, 0.04084, 0.01021], a = [1, -1.968, 1.736, -0.7245, 0.1204]), 30 samples each computed by the package; the step response settles at the DC gain 1 after overshooting to 1.11966. Marked: the largest impulse sample h[4] = 0.289522.010203000.51DC gain 1h[4] = 0.289522step response s[n]impulse response h[n]n — sampleamplitude
Impulse response (stems) and step response (line) of the order-4 Butterworth low-pass filter designed by the package for fc = 1000 Hz at fs = 8000 Hz (b = [0.01021, 0.04084, 0.06126, 0.04084, 0.01021], a = [1, -1.968, 1.736, -0.7245, 0.1204]), 30 samples each computed by the package; the step response settles at the DC gain 1 after overshooting to 1.11966. Marked: the largest impulse sample h[4] = 0.289522.

Poles and zeros of a digital low-pass filter

H(z) = \frac{\sum_k b_k z^{-k}}{\sum_k a_k z^{-k}} = \frac{b_0\prod(1 - z_i z^{-1})}{a_0\prod(1 - p_i z^{-1})}
Poles and zeros of a digital low-pass filterPoles and zeros returned by the package for the order-4 Butterworth low-pass filter (fc = 1000 Hz, fs = 8000 Hz) designed by it: 4 poles, largest radius 0.757669 (inside the unit circle: stable), and 4 zeros clustered at z = −1 (each within 0.000351186 of it).-101-1-0.500.51unit circlepoleszerosRe zIm z
Poles and zeros returned by the package for the order-4 Butterworth low-pass filter (fc = 1000 Hz, fs = 8000 Hz) designed by it: 4 poles, largest radius 0.757669 (inside the unit circle: stable), and 4 zeros clustered at z = −1 (each within 0.000351186 of it).

Filtering a signal: input and FIR low-pass output

y[n] = \sum_{k=0}^{M} b_k\,x[n-k]
Filtering a signal: input and FIR low-pass outputA sampled signal (fs = 8000 Hz; a 166.7 Hz tone plus a 3000 Hz tone of amplitude 0.4) and the output of the 21-tap Hamming-window FIR low-pass filter (fc = 1000 Hz) designed by the package, the output computed by it sample by sample: the 3000 Hz component is removed and the slow tone passes, delayed by 10 samples (1.25 ms).02.557.510-101input: 167 Hz + 3000 Hzoutput of the 21-tap FIR low-passt — time [ms]amplitude
A sampled signal (fs = 8000 Hz; a 166.7 Hz tone plus a 3000 Hz tone of amplitude 0.4) and the output of the 21-tap Hamming-window FIR low-pass filter (fc = 1000 Hz) designed by the package, the output computed by it sample by sample: the 3000 Hz component is removed and the slow tone passes, delayed by 10 samples (1.25 ms).
Formulas

The mathematics inside

12 of its 74 formulas; every one is in the capability browser below.

Nyquist rate
f_{s,\min} = 2 f_{\max}
DFT spectrum of a sequence (FFT)
X[k] = \sum_{n=0}^{N-1} x[n]\,e^{-j2\pi kn/N},\ k = 0,\dots,N-1
Bit error rate of BPSK (and coherent BFSK) in AWGN
P_b = Q\!\left(\sqrt{2E_b/N_0}\right) = \tfrac12\,\mathrm{erfc}\sqrt{E_b/N_0}
Reflection coefficient, VSWR and return loss of a load
\Gamma = \frac{Z_L - Z_0}{Z_L + Z_0},\quad \mathrm{VSWR} = \frac{1 + |\Gamma|}{1 - |\Gamma|}
Digital Butterworth filter design (bilinear transform)
s = 2f_s\frac{1 - z^{-1}}{1 + z^{-1}},\quad \omega_c = 2f_s\tan\frac{\pi f_c}{f_s}
Magnitude of an analog Butterworth low-pass response
|H(f)| = \frac{1}{\sqrt{1 + (f/f_c)^{2N}}}
Gain of a parabolic dish (aperture) antenna
G = \eta\left(\frac{\pi D}{\lambda}\right)^2
Shannon capacity of an AWGN channel
C = B\log_2(1 + \mathrm{SNR})
Minimum order of a analog Butterworth filter
N \ge \frac{\log_{10}\frac{10^{A_s/10}-1}{10^{R_p/10}-1}}{2\log_{10}(\omega_s/\omega_p)}
Minimum SNR for a data rate (Shannon limit)
\mathrm{SNR}_{\min} = 2^{C/B} - 1,\quad \left(\tfrac{E_b}{N_0}\right)_{\min} = \frac{2^{C/B}-1}{C/B}
Circular (cyclic) convolution
y[n] = \sum_{k=0}^{N-1} x[k]\,h[(n-k)\bmod N]
Frequency of a DFT bin
f_k = \frac{k\,f_s}{N}
Capabilities

Every capability, with an example

Search by name, formula, input or topic. Each capability opens to show what it takes, what it returns, when it applies, and a question it answered.

74 capabilities

Analog filters 3

Magnitude of an analog Butterworth low-pass responsebutterworth_magnitude

|H(f)| = 1/sqrt(1 + (f/fc)^(2N)) of an N-th order Butterworth low-pass filter, and the attenuation in dB.

|H(f)| = \frac{1}{\sqrt{1 + (f/f_c)^{2N}}}

Inputs

  • N filter order integer
  • fc cutoff (-3 dB) frequency [Hz]
  • f frequency [Hz]

Returns

  • magnitude |H(f)|
  • attenuation_db attenuation in dB (positive)

Applies when

  • N >= 1
  • fc > 0
  • f >= 0

Example

m.ask("What is the magnitude response of a 4th-order Butterworth low-pass filter with a cutoff frequency of 1 kHz at 2 kHz?")
→ magnitude = 0.0623783, attenuation_db = 24.0993
Minimum order of a analog Butterworth filterbutterworth_order_analog

The smallest order meeting a passband edge with at most Rp dB attenuation and a stopband edge with at least As dB.

N \ge \frac{\log_{10}\frac{10^{A_s/10}-1}{10^{R_p/10}-1}}{2\log_{10}(\omega_s/\omega_p)}

Inputs

  • fp passband edge frequency [Hz]
  • fstop stopband edge frequency [Hz]
  • Rp maximum passband attenuation (ripple) in dB
  • As minimum stopband attenuation in dB

Returns

  • order minimum filter order
  • type lowpass (fp < fstop) or highpass (fp > fstop)

Applies when

  • 0 < Rp < As
  • fp != fstop

Example

m.ask("What Butterworth filter order is needed for a passband edge of 1 kHz with at most 1 dB ripple and a stopband edge of 2 kHz with at least 40 dB attenuation?")
→ order = 8, type = lowpass
Minimum order of a analog Chebyshev type I filterchebyshev1_order_analog

The smallest order meeting a passband edge with at most Rp dB attenuation and a stopband edge with at least As dB.

N \ge \frac{\cosh^{-1}\sqrt{\frac{10^{A_s/10}-1}{10^{R_p/10}-1}}}{\cosh^{-1}(\omega_s/\omega_p)}

Inputs

  • fp passband edge frequency [Hz]
  • fstop stopband edge frequency [Hz]
  • Rp maximum passband attenuation (ripple) in dB
  • As minimum stopband attenuation in dB

Returns

  • order minimum filter order
  • type lowpass (fp < fstop) or highpass (fp > fstop)

Applies when

  • 0 < Rp < As
  • fp != fstop

Example

m.ask("What Chebyshev filter order is needed for a passband edge of 1 kHz with at most 1 dB ripple and a stopband edge of 2 kHz with at least 40 dB attenuation?")
→ order = 5, type = lowpass

Antennas 1

Gain of a parabolic dish (aperture) antennadish_antenna_gain

The gain eta (pi D / lambda)^2 of a circular aperture antenna of diameter D and aperture efficiency eta, in dBi, and its effective aperture.

G = \eta\left(\frac{\pi D}{\lambda}\right)^2

Inputs

  • D dish diameter [m]
  • f frequency [Hz]
  • eta aperture efficiency (0 < eta <= 1)

Returns

  • G_dbi gain in dBi
  • G gain as a ratio
  • Ae effective aperture [m^2]

Applies when

  • 0 < eta <= 1
  • D >= one wavelength

Example

m.ask("What is the gain of a parabolic dish with a diameter of 3 m at 10 GHz and an aperture efficiency of 55%?")
→ G_dbi = 47.3526, G = 54358, Ae = 3.88772 m^2

Communication links 2

Minimum SNR for a data rate (Shannon limit)shannon_min_snr

The smallest SNR = 2^(C/B) - 1 that lets an AWGN channel of bandwidth B carry C bit/s, and the corresponding minimum Eb/N0.

\mathrm{SNR}_{\min} = 2^{C/B} - 1,\quad \left(\tfrac{E_b}{N_0}\right)_{\min} = \frac{2^{C/B}-1}{C/B}

Inputs

  • C data rate in bit/s
  • B bandwidth [Hz]

Returns

  • snr_db minimum SNR in dB
  • snr minimum SNR (linear)
  • ebn0_min_db minimum Eb/N0 in dB

Applies when

  • additive white Gaussian noise
  • C/B <= 200

Example

m.ask("What minimum SNR is needed to send 10 Mbit/s over a bandwidth of 2 MHz?")
→ snr_db = 14.9136, snr = 31, ebn0_min_db = 7.92392
Shannon capacity of an AWGN channelshannon_capacity

The channel capacity C = B log2(1 + SNR) of a band-limited additive white Gaussian noise channel and the spectral efficiency C/B.

C = B\log_2(1 + \mathrm{SNR})

Inputs

  • B bandwidth [Hz]
  • snr_db signal-to-noise ratio in dB

Returns

  • C capacity in bit/s
  • efficiency spectral efficiency in bit/s per Hz

Applies when

  • additive white Gaussian noise
  • SNR stated in dB

Example

m.ask("What is the Shannon capacity of a 3 kHz channel with an SNR of 30 dB?")
→ C = 29901.7, efficiency = 9.96723

Convolution and correlation 3

Circular (cyclic) convolutioncircular_convolution

The N-point circular convolution y[n] = sum_k x[k] h[(n-k) mod N] of two sequences of length N.

y[n] = \sum_{k=0}^{N-1} x[k]\,h[(n-k)\bmod N]

Inputs

  • x first sequence (length N) vector
  • h second sequence (length N) vector

Returns

  • y circular convolution y[0..N-1]

Applies when

  • both sequences have length N

Example

m.ask("Compute the circular convolution of x = [1, 2, 3, 4] and h = [1, 0, 0, 1].")
→ y = [3.0, 5.0, 7.0, 5.0]
Cross-correlation and the lag of its peakcross_correlation

r_xy[l] = sum_n x[n+l] y[n] for every lag l, and the lag at which it is largest (the delay of x relative to y).

r_{xy}[\ell] = \sum_n x[n+\ell]\,y[n]

Inputs

  • x first sequence x[n] vector
  • y second (reference) sequence y[n] vector

Returns

  • peak_lag lag of the largest correlation (positive: x lags y)
  • peak_value largest correlation value
  • r correlation at every lag
  • lags the lags, -(Ny-1) .. Nx-1

Applies when

  • finite sequences starting at n = 0

Example

m.ask("Find the cross-correlation of x = [0, 0, 1, 2, 1] and y = [1, 2, 1] and the lag of its peak.")
→ peak_lag = 2, peak_value = 6, r = [0.0, 0.0, 1.0, 4.0, 6.0, 4.0, 1.0], lags = [-2, -1, 0, 1, 2, 3, 4]
Linear convolution of two sequenceslinear_convolution

y[n] = sum_k x[k] h[n-k], the full linear convolution (length Nx + Nh - 1).

y[n] = \sum_k x[k]\,h[n-k]

Inputs

  • x first sequence x[n] vector
  • h second sequence h[n] vector

Returns

  • y convolution y[n], n = 0 .. Nx+Nh-2
  • length number of output samples

Applies when

  • finite sequences starting at n = 0

Example

m.ask("Compute the linear convolution of x = [1, 2, 3] and h = [1, -1].")
→ y = [1.0, 1.0, 1.0, -3.0], length = 4

DFT and FFT 5

DFT spectrum of a sequence (FFT)dft_spectrum

The whole N-point DFT of a real sequence: magnitude, phase, real and imaginary parts of every bin, and the strongest bin up to N/2.

X[k] = \sum_{n=0}^{N-1} x[n]\,e^{-j2\pi kn/N},\ k = 0,\dots,N-1

Inputs

  • x samples x[0..N-1] vector

Returns

  • peak_magnitude largest |X[k]| for 0 <= k <= N/2
  • peak_bin bin of the largest magnitude
  • magnitude |X[k]| for every bin
  • phase phase of X[k] in radians for every bin
  • real real parts
  • imag imaginary parts

Applies when

  • real samples

Example

m.ask("Compute the DFT of x = [1, 2, 3, 4].")
→ peak_magnitude = 10, peak_bin = 0, magnitude = [10.0, 2.8284271247461903, 2.0, 2.8284271247461903], phase = [0.0, 2.356194490192345, 3.141592653589793, -2.356194490192345], real = [10.0, -2.0, -2.0, -2.0], imag = [0.0, 2.0, 0.0, -2.0]
Frequency of a DFT binbin_frequency

The frequency k*fs/N that bin k of an N-point DFT represents (0 <= k <= N/2).

f_k = \frac{k\,f_s}{N}

Inputs

  • k bin index integer
  • fs sampling rate [Hz]
  • N number of DFT points integer

Returns

  • f_k frequency of bin k [Hz]

Applies when

  • 0 <= k <= N/2
  • fs > 0

Example

m.ask("What frequency does bin 100 of a 1024-point FFT correspond to at a sampling rate of 48 kHz?")
→ f_k = 4687.5 Hz
Frequency resolution of an N-point DFTfrequency_resolution

The bin spacing fs/N of an N-point DFT or FFT and the record length N/fs it covers.

\Delta f = \frac{f_s}{N}

Inputs

  • fs sampling rate [Hz]
  • N number of DFT points integer

Returns

  • df frequency resolution (bin spacing) [Hz]
  • duration record length N/fs [s]

Applies when

  • fs > 0
  • N >= 2

Example

m.ask("What is the frequency resolution of a 1024-point FFT at a sampling rate of 48 kHz?")
→ df = 46.875 Hz, duration = 0.0213333 s
Inverse discrete Fourier transforminverse_dft

x[n] = (1/N) sum_k X[k] exp(+j 2 pi k n / N), from the real and imaginary parts of X[k].

x[n] = \frac{1}{N}\sum_{k=0}^{N-1} X[k]\,e^{j2\pi kn/N}

Inputs

  • re_ real parts of X[0..N-1] vector
  • im imaginary parts of X[0..N-1] (zeros if not given) vector optional

Returns

  • real real parts of x[n]
  • imag imaginary parts of x[n]

Applies when

  • both lists have the same length

Example

m.ask("Compute the inverse DFT with real parts [10, -2, -2, -2] and imaginary parts [0, 2, 0, -2].")
→ real = [1.0, 2.0, 3.0, 4.0], imag = [0.0, 0.0, 0.0, 0.0]
One bin of the discrete Fourier transformdft_bin

X[k] = sum_n x[n] exp(-j 2 pi k n / N) for one bin k: real and imaginary parts, magnitude and phase.

X[k] = \sum_{n=0}^{N-1} x[n]\,e^{-j2\pi kn/N}

Inputs

  • x samples x[0..N-1] vector
  • k bin index (0 <= k < N) integer

Returns

  • magnitude |X[k]|
  • phase phase of X[k] in radians (-pi, pi] [rad]
  • re real part of X[k]
  • im imaginary part of X[k]

Applies when

  • 0 <= k < N

Example

m.ask("Compute the DFT of x = [1, 2, 3, 4] at bin k = 1.")
→ magnitude = 2.82843, phase = 2.35619 rad, re = -2, im = 2

Decibels and levels 8

Amplitude (voltage) ratio to decibelsamplitude_ratio_to_db

A voltage, current or field amplitude ratio in decibels, 20*log10(V2/V1).

L = 20\log_{10}\frac{V_2}{V_1}\ \mathrm{dB}

Inputs

  • ratio amplitude ratio V2/V1 (a positive number)

Returns

  • dB level in decibels (dB)

Applies when

  • ratio > 0
  • both amplitudes across equal impedances

Example

m.ask("Express a voltage ratio of 50 in decibels.")
→ dB = 33.9794
Decibels to amplitude (voltage) ratiodb_to_amplitude_ratio

The amplitude ratio V2/V1 = 10^(L/20) that a level of L dB represents.

\frac{V_2}{V_1} = 10^{L/20}

Inputs

  • dB level in decibels

Returns

  • ratio amplitude ratio V2/V1

Applies when

  • finite level

Example

m.ask("What voltage ratio corresponds to 6 dB?")
→ ratio = 1.99526
Decibels to power ratiodb_to_power_ratio

The power ratio P2/P1 = 10^(L/10) that a level of L dB represents.

\frac{P_2}{P_1} = 10^{L/10}

Inputs

  • dB level in decibels

Returns

  • ratio power ratio P2/P1

Applies when

  • finite level

Example

m.ask("What power ratio corresponds to 23 dB?")
→ ratio = 199.526
Power in watts to dBm and dBWwatts_to_dbm

A power expressed as a level relative to 1 mW (dBm) and to 1 W (dBW).

P_{\mathrm{dBm}} = 10\log_{10}\frac{P}{1\,\mathrm{mW}}

Inputs

  • P power [W]

Returns

  • dBm power level in dBm
  • dBW power level in dBW

Applies when

  • P > 0

Example

m.ask("Convert 2 W to dBm.")
→ dBm = 33.0103, dBW = 3.0103
Power level in dBm to wattsdbm_to_watts

The power in watts of a level given in dBm (and the same level in dBW).

P = 1\,\mathrm{mW}\cdot 10^{P_{\mathrm{dBm}}/10}

Inputs

  • dBm power level in dBm

Returns

  • P power [W]
  • dBW power level in dBW

Applies when

  • finite level

Example

m.ask("Convert 30 dBm to watts.")
→ P = 1 W, dBW = 0
Power ratio to decibelspower_ratio_to_db

A power ratio expressed in decibels, 10*log10(P2/P1).

L = 10\log_{10}\frac{P_2}{P_1}\ \mathrm{dB}

Inputs

  • ratio power ratio P2/P1 (a positive number)

Returns

  • dB level in decibels (dB)

Applies when

  • ratio > 0

Example

m.ask("Express a power ratio of 200 in decibels.")
→ dB = 23.0103
Signal-to-noise ratio from signal and noise powerssnr_from_powers

The signal-to-noise ratio Ps/Pn, as a ratio and in dB.

\mathrm{SNR}_{\mathrm{dB}} = 10\log_{10}\frac{P_s}{P_n}

Inputs

  • Ps signal power [W]
  • Pn noise power [W]

Returns

  • snr_db signal-to-noise ratio in dB
  • snr signal-to-noise ratio (linear)

Applies when

  • Ps > 0
  • Pn > 0

Example

m.ask("What is the SNR in dB for a signal power of 2 mW and a noise power of 10 uW?")
→ snr = 200, snr_db = 23.0103
Total power of several signals given in dBmdbm_power_sum

The combined power of uncorrelated signals whose levels are given in dBm (powers add, levels do not).

P_{\mathrm{tot}} = 10\log_{10}\sum_i 10^{P_i/10}\ \mathrm{dBm}

Inputs

  • levels power levels in dBm vector

Returns

  • total_dBm total power level in dBm
  • total_W total power [W]

Applies when

  • uncorrelated signals (their powers add)

Example

m.ask("What is the total power of signals at [10, 10] dBm combined?")
→ total_dBm = 13.0103, total_W = 0.02 W

Digital communication 5

Bit and symbol error rates of QPSK in AWGNqpsk_error_rates

Gray-coded coherent QPSK: bit error rate Q(sqrt(2 Eb/N0)) and symbol error rate 2Q - Q^2.

P_b = Q\!\left(\sqrt{2E_b/N_0}\right),\quad P_s = 2Q - Q^2

Inputs

  • ebn0_db Eb/N0 in dB

Returns

  • ber bit error rate (Gray coding)
  • ser symbol error rate

Applies when

  • coherent detection
  • Gray coding
  • AWGN channel

Example

m.ask("What are the bit and symbol error rates of QPSK at Eb/N0 = 6 dB?")
→ ber = 0.00238829, ser = 0.00477088
Bit error rate of BPSK (and coherent BFSK) in AWGNbpsk_ber

The bit error probability of coherent BPSK, Q(sqrt(2 Eb/N0)), and of coherent orthogonal BFSK, Q(sqrt(Eb/N0)), in additive white Gaussian noise.

P_b = Q\!\left(\sqrt{2E_b/N_0}\right) = \tfrac12\,\mathrm{erfc}\sqrt{E_b/N_0}

Inputs

  • ebn0_db Eb/N0 in dB

Returns

  • ber BPSK bit error rate
  • ber_bfsk coherent BFSK bit error rate

Applies when

  • coherent detection
  • AWGN channel
  • Eb/N0 stated in dB

Example

m.ask("What is the bit error rate of BPSK at Eb/N0 = 8 dB?")
→ ber = 0.000190908, ber_bfsk = 0.00600439
Bit error rates of DPSK and noncoherent BFSKnoncoherent_ber

The bit error rates of differentially coherent BPSK (DPSK), exp(-Eb/N0)/2, and of noncoherent orthogonal BFSK, exp(-Eb/2N0)/2, in AWGN.

P_b^{\mathrm{DPSK}} = \tfrac12 e^{-E_b/N_0},\quad P_b^{\mathrm{NCFSK}} = \tfrac12 e^{-E_b/2N_0}

Inputs

  • ebn0_db Eb/N0 in dB

Returns

  • ber_dpsk DPSK bit error rate
  • ber_ncfsk noncoherent BFSK bit error rate

Applies when

  • AWGN channel
  • slow phase variation (DPSK)
  • orthogonal tones (FSK)

Example

m.ask("What is the bit error rate of DPSK at Eb/N0 = 8 dB?")
→ ber_dpsk = 0.000909404, ber_ncfsk = 0.0213237
Symbol error rate of M-PSK in AWGNmpsk_symbol_error

The exact symbol error rate of coherent M-PSK (M = 2 to 64) at a given Eb/N0 (Craig's integral), and the Gray-coded bit error rate approximation.

P_s = \frac{1}{\pi}\int_0^{(M-1)\pi/M} \exp\!\left(-\frac{E_s}{N_0}\frac{\sin^2(\pi/M)}{\sin^2\theta}\right)d\theta

Inputs

  • M number of phases choice
  • ebn0_db Eb/N0 in dB

Returns

  • ser symbol error rate
  • ber_approx bit error rate approximation SER/log2 M

Applies when

  • coherent detection
  • AWGN channel

Example

m.ask("What is the symbol error rate of 8-PSK at Eb/N0 = 10 dB?")
→ ser = 0.00303419, ber_approx = 0.0010114
Symbol error rate of square M-QAM in AWGNmqam_symbol_error

The exact symbol error rate of coherent square M-QAM (4 to 1024 points) at a given Eb/N0, and the Gray-coded bit error rate approximation SER/log2 M.

P_s = 1 - \left[1 - 2\left(1 - \tfrac{1}{\sqrt M}\right)Q\!\left(\sqrt{\tfrac{3E_s}{(M-1)N_0}}\right)\right]^2

Inputs

  • M constellation size choice
  • ebn0_db Eb/N0 in dB

Returns

  • ser symbol error rate
  • ber_approx bit error rate approximation (Gray coding)

Applies when

  • square constellation
  • coherent detection
  • AWGN channel

Example

m.ask("What is the symbol error rate of 16-QAM at Eb/N0 = 10 dB?")
→ ser = 0.00700429, ber_approx = 0.00175107

Digital filters 10

Bilinear transform of a first-order low-pass filterbilinear_rc_lowpass

The digital filter H(z) = (b0 + b1 z^-1)/(1 + a1 z^-1) obtained from H(s) = wc/(s + wc) by the bilinear transform s = 2 fs (1 - z^-1)/(1 + z^-1), without pre-warping.

H(z) = \frac{\omega_c (1 + z^{-1})}{(\omega_c + 2f_s) + (\omega_c - 2f_s) z^{-1}}

Inputs

  • fc analog cutoff frequency [Hz]
  • fs sampling rate [Hz]

Returns

  • b0 numerator coefficient b0
  • b1 numerator coefficient b1
  • a1 denominator coefficient a1 (a0 = 1)

Applies when

  • fc > 0
  • fs > 0
  • no frequency pre-warping

Example

m.ask("Apply the bilinear transform to a first-order low-pass filter with a cutoff frequency of 1 kHz at a sampling rate of 8 kHz.")
→ b0 = 0.28197, b1 = 0.28197, a1 = -0.43606
DC gain of a digital filterdc_gain

The gain H(1) = sum b / sum a of the filter at zero frequency, and its level in dB.

H(1) = \frac{\sum_k b_k}{\sum_k a_k}

Inputs

  • b numerator coefficients b vector
  • a denominator coefficients a (1 if not given) vector optional

Returns

  • gain DC gain H(z = 1) (signed)
  • gain_db 20 log10 |H(1)| in dB

Applies when

  • sum of a != 0 (no pole at z = 1)

Example

m.ask("What is the DC gain of the filter with b = [1, 2, 1] and a = [1, -0.5, 0.25]?")
→ gain = 5.33333, gain_db = 14.54
FIR filter outputfir_filter_output

The output y[n] = sum_k b[k] x[n-k] of an FIR filter with coefficients b (zero initial conditions, same length as x).

y[n] = \sum_{k=0}^{M} b_k\,x[n-k]

Inputs

  • b filter coefficients (taps) b[0..M] vector
  • x input samples vector

Returns

  • y output samples

Applies when

  • zero initial conditions

Example

m.ask("Filter x = [1, 2, 3, 4] with the FIR filter b = [0.5, 0.5].")
→ y = [0.5, 1.5, 2.5, 3.5]
Frequency response of a digital filter at one frequencyfrequency_response

H(e^{jw}) = B(e^{jw}) / A(e^{jw}) at w = 2 pi f / fs: magnitude, magnitude in dB and phase.

H(e^{j\omega}) = \frac{\sum_k b_k e^{-j\omega k}}{\sum_k a_k e^{-j\omega k}},\ \omega = 2\pi f/f_s

Inputs

  • b numerator coefficients b vector
  • f frequency [Hz]
  • fs sampling rate [Hz]
  • a denominator coefficients a (1 if not given) vector optional

Returns

  • magnitude |H|
  • magnitude_db 20 log10 |H| in dB
  • phase phase of H in radians [rad]

Applies when

  • 0 <= f <= fs/2
  • no pole on the unit circle at f

Example

m.ask("What is the magnitude response of the filter b = [1, 1] at 1 kHz with a sampling rate of 8 kHz?")
→ magnitude = 1.84776, magnitude_db = 5.33291, phase = -0.392699 rad
Group delay of a digital filtergroup_delay

The group delay -d(phase)/dw of H(z) = B(z)/A(z) at frequency f, in samples and in seconds.

\tau_g(\omega) = -\frac{d\angle H(e^{j\omega})}{d\omega} = \mathrm{Re}\frac{\sum k b_k e^{-j\omega k}}{\sum b_k e^{-j\omega k}} - \mathrm{Re}\frac{\sum k a_k e^{-j\omega k}}{\sum a_k e^{-j\omega k}}

Inputs

  • b numerator coefficients b vector
  • f frequency [Hz]
  • fs sampling rate [Hz]
  • a denominator coefficients a (1 if not given) vector optional

Returns

  • samples group delay in samples
  • seconds group delay in seconds [s]

Applies when

  • 0 <= f <= fs/2
  • no zero or pole of H on the unit circle at f

Example

m.ask("Find the group delay of the FIR filter b = [1, 2, 3, 2, 1] at 500 Hz with a sampling rate of 8 kHz.")
→ samples = 2, seconds = 0.00025 s
IIR filter output (difference equation)iir_filter_output

The output of the recursive filter a[0] y[n] = sum_k b[k] x[n-k] - sum_{k>=1} a[k] y[n-k] (zero initial conditions).

a_0 y[n] = \sum_k b_k x[n-k] - \sum_{k\ge 1} a_k y[n-k]

Inputs

  • b feed-forward coefficients b vector
  • a feedback coefficients a (a[0] != 0) vector
  • x input samples vector

Returns

  • y output samples

Applies when

  • a[0] != 0
  • zero initial conditions

Example

m.ask("Find the output of the IIR filter with b = [1] and a = [1, -0.5] for the input x = [1, 0, 0, 0].")
→ y = [1.0, 0.5, 0.25, 0.125]
Impulse response of a digital filterimpulse_response

The first n samples of the impulse response h[n] of the filter with coefficients b and a.

h[n] = \mathcal{Z}^{-1}\{B(z)/A(z)\}

Inputs

  • b numerator coefficients b vector
  • a denominator coefficients a (a[0] != 0) vector
  • n number of samples integer

Returns

  • h impulse response h[0..n-1]

Applies when

  • a[0] != 0

Example

m.ask("Find the first 5 samples of the impulse response of the filter with b = [1] and a = [1, -0.5].")
→ h = [1.0, 0.5, 0.25, 0.125, 0.0625]
Minimum order of a digital (bilinear) Butterworth filterbutterworth_order_digital

The smallest order meeting a passband edge with at most Rp dB attenuation and a stopband edge with at least As dB (digital design by the bilinear transform: edges pre-warped with tan(pi f / fs)).

N \ge \frac{\log_{10}\frac{10^{A_s/10}-1}{10^{R_p/10}-1}}{2\log_{10}(\omega_s/\omega_p)}

Inputs

  • fp passband edge frequency [Hz]
  • fstop stopband edge frequency [Hz]
  • fs sampling rate [Hz]
  • Rp maximum passband attenuation (ripple) in dB
  • As minimum stopband attenuation in dB

Returns

  • order minimum filter order
  • type lowpass (fp < fstop) or highpass (fp > fstop)

Applies when

  • 0 < Rp < As
  • fp != fstop
  • both edges below fs/2

Example

m.ask("What Butterworth filter order is needed for a passband edge of 1 kHz with at most 1 dB ripple and a stopband edge of 2 kHz with at least 40 dB attenuation at a sampling rate of 10 kHz?")
→ order = 7, type = lowpass
Moving-average filter outputmoving_average

The causal M-point moving average y[n] = (1/M) sum_{i=0}^{M-1} x[n-i], with x[n] = 0 before the first sample.

y[n] = \frac{1}{M}\sum_{i=0}^{M-1} x[n-i]

Inputs

  • x input samples vector
  • M window length (points averaged) integer

Returns

  • y output samples (same length as x)

Applies when

  • M >= 1
  • zero initial conditions

Example

m.ask("Apply a 3-point moving average to x = [3, 6, 9, 12].")
→ y = [1.0, 3.0, 6.0, 9.0]
Step response of a digital filterstep_response

The first n samples of the response s[n] of the filter (b, a) to a unit step.

s[n] = \sum_{m=0}^{n} h[m]

Inputs

  • b numerator coefficients b vector
  • a denominator coefficients a (a[0] != 0) vector
  • n number of samples integer

Returns

  • s step response s[0..n-1]

Applies when

  • a[0] != 0

Example

m.ask("Find the first 4 samples of the step response of the filter with b = [1] and a = [1, -0.5].")
→ s = [1.0, 1.5, 1.75, 1.875]

Filter design 3

Digital Butterworth filter design (bilinear transform)butterworth_design

The coefficients b and a of an N-th order digital Butterworth low-pass or high-pass filter with cutoff fc at sampling rate fs (bilinear transform with pre-warping).

s = 2f_s\frac{1 - z^{-1}}{1 + z^{-1}},\quad \omega_c = 2f_s\tan\frac{\pi f_c}{f_s}

Inputs

  • N filter order (1..8) integer
  • fc cutoff (-3 dB) frequency [Hz]
  • fs sampling rate [Hz]
  • btype lowpass or highpass choice

Returns

  • b numerator coefficients b[0..N]
  • a denominator coefficients a[0..N] (a[0] = 1)

Applies when

  • 0 < fc < fs/2
  • 1 <= N <= 8

Example

m.ask("Design a 2nd-order Butterworth low-pass filter with a cutoff frequency of 1 kHz at a sampling rate of 8 kHz. Give the coefficients.")
→ b = [0.0976310729378, 0.195262145876, 0.0976310729378], a = [1.0, -0.942809041582, 0.333333333333]
FIR low-pass filter design by the window methodfir_window_design

The N taps of a linear-phase FIR low-pass filter with cutoff fc: an ideal (sinc) impulse response shifted by (N-1)/2, multiplied by a rectangular, Hann, Hamming or Blackman window and scaled to unit DC gain.

h[n] \propto \frac{2f_c}{f_s}\,\mathrm{sinc}\!\left(\frac{2f_c}{f_s}\left(n - \tfrac{N-1}{2}\right)\right) w[n]

Inputs

  • N number of taps integer
  • fc cutoff frequency [Hz]
  • fs sampling rate [Hz]
  • window window type choice

Returns

  • h filter taps h[0..N-1]

Applies when

  • 0 < fc < fs/2
  • symmetric window
  • taps scaled so that the DC gain is 1

Example

m.ask("Design a 5-tap FIR low-pass filter with a Hamming window, a cutoff frequency of 1 kHz and a sampling rate of 8 kHz.")
→ h = [0.024553834015, 0.234389464238, 0.482113403494, 0.234389464238, 0.024553834015]
Second-order IIR notch filter designnotch_filter_design

The coefficients of a second-order IIR notch filter removing frequency f0 with quality factor Q (bandwidth f0/Q at -3 dB) at sampling rate fs.

H(z) = g\,\frac{1 - 2\cos\omega_0 z^{-1} + z^{-2}}{1 - 2g\cos\omega_0 z^{-1} + (2g - 1)z^{-2}},\ g = \frac{1}{1 + \tan(\omega_0/2Q)}

Inputs

  • f0 frequency to remove [Hz]
  • Q quality factor f0 / bandwidth
  • fs sampling rate [Hz]

Returns

  • b numerator coefficients b0, b1, b2
  • a denominator coefficients 1, a1, a2

Applies when

  • 0 < f0 < fs/2
  • Q > 0

Example

m.ask("Design a notch filter at 60 Hz with a quality factor of 30 for a sampling rate of 1 kHz.")
→ b = [0.9937559649536571, -1.8479418578501994, 0.9937559649536571], a = [1.0, -1.8479418578501994, 0.9875119299073143]

Fourier series and transforms 5

Analytic signal, Hilbert transform and envelopeanalytic_envelope

The discrete Hilbert transform of a real sequence and its envelope |x + j H{x}|, computed through the DFT (negative frequencies removed, positive ones doubled).

x_a[n] = \mathrm{IDFT}\{X[k]\,h[k]\},\quad \text{envelope} = |x_a[n]|

Inputs

  • x real samples vector

Returns

  • envelope envelope |x_a[n]|
  • hilbert Hilbert transform (imaginary part of the analytic signal)

Applies when

  • the sequence treated as one period (DFT-based transform)

Example

m.ask("Find the Hilbert transform and envelope of x = [1, 0, -1, 0].")
→ envelope = [1.0, 1.0, 1.0, 1.0], hilbert = [0.0, 1.0, 0.0, -1.0]
Fourier transform of a decaying exponentialexponential_pulse_spectrum

X(f) = A tau / (1 + j 2 pi f tau) of x(t) = A exp(-t/tau) for t >= 0: magnitude, phase, real and imaginary parts.

X(f) = \frac{A\tau}{1 + j2\pi f\tau}

Inputs

  • A initial amplitude
  • tau time constant [s]
  • f frequency [Hz]

Returns

  • magnitude |X(f)|
  • phase phase of X(f) in radians [rad]
  • re real part
  • im imaginary part

Applies when

  • A > 0
  • tau > 0
  • x(t) = 0 for t < 0

Example

m.ask("What is the Fourier transform of a decaying exponential with amplitude 2 and time constant 0.5 s at 0 Hz?")
→ magnitude = 1, phase = 0 rad, re = 1, im = 0
Fourier transform of a rectangular pulserect_pulse_spectrum

X(f) = A tau sinc(f tau) of a rectangular pulse of amplitude A and width tau centred at t = 0, its magnitude, and the first spectral null 1/tau.

X(f) = A\tau\,\mathrm{sinc}(f\tau) = A\tau\frac{\sin(\pi f\tau)}{\pi f\tau}

Inputs

  • A pulse amplitude
  • tau pulse width [s]
  • f frequency [Hz]

Returns

  • X X(f) (real, in amplitude-seconds)
  • magnitude |X(f)|
  • first_null first zero of the spectrum, 1/tau [Hz]

Applies when

  • A != 0
  • tau > 0
  • the pulse centred at t = 0

Example

m.ask("What is the Fourier transform of a rectangular pulse of amplitude 2 and width 1 ms at 250 Hz?")
→ X = 0.00180063, magnitude = 0.00180063, first_null = 1000 Hz
Harmonic amplitude of a square, triangle or sawtooth wavefourier_series_harmonic

The amplitude of the n-th harmonic in the Fourier series of a zero-mean square, triangle or sawtooth wave of peak amplitude A, relative to the fundamental, and its RMS value.

c_n^{\mathrm{sq}} = \frac{4A}{n\pi},\ c_n^{\mathrm{tri}} = \frac{8A}{\pi^2 n^2}\ (n\ \text{odd}),\quad c_n^{\mathrm{saw}} = \frac{2A}{n\pi}

Inputs

  • waveform waveform choice
  • A peak amplitude of the wave
  • n harmonic number (1 = fundamental) integer

Returns

  • amplitude amplitude of the n-th harmonic
  • relative amplitude relative to the fundamental
  • rms RMS value of the n-th harmonic

Applies when

  • zero-mean waveform with peak A
  • 50 % duty square wave
  • symmetric triangle
  • linear sawtooth

Example

m.ask("What is the amplitude of the 3rd harmonic of a square wave with amplitude 2?")
→ amplitude = 0.848826, relative = 0.333333, rms = 0.600211
Total harmonic distortionthd

THD = sqrt(V2^2 + V3^2 + ...)/V1 from the amplitudes of the fundamental and its harmonics, as a ratio, in percent and in dB.

\mathrm{THD} = \frac{\sqrt{\sum_{n\ge 2} V_n^2}}{V_1}

Inputs

  • V amplitudes [V1, V2, V3, ...] of the fundamental and harmonics vector

Returns

  • thd THD as a ratio
  • percent THD in percent
  • db THD in dB

Applies when

  • V1 > 0
  • amplitudes >= 0 (RMS or peak, all alike)

Example

m.ask("What is the total harmonic distortion of a signal with harmonic amplitudes [10, 0.5, 0.3, 0.1]?")
→ thd = 0.0591608, percent = 5.91608, db = -24.5593

Modulation 3

AM modulation index from the envelopeam_modulation_index

The modulation index m = (Vmax - Vmin)/(Vmax + Vmin) of an AM wave from the maximum and minimum of its envelope, and the carrier amplitude.

m = \frac{V_{\max} - V_{\min}}{V_{\max} + V_{\min}}

Inputs

  • Vmax maximum of the envelope [V]
  • Vmin minimum of the envelope [V]

Returns

  • m modulation index
  • Ac carrier amplitude (Vmax + Vmin)/2 [V]

Applies when

  • 0 <= Vmin < Vmax
  • sinusoidal message

Example

m.ask("An AM envelope has a maximum of 10 V and a minimum of 2 V. What is the modulation index?")
→ m = 0.666667, Ac = 6 V
FM spectrum: Carson bandwidth and Bessel sideband amplitudesfm_spectrum

For sinusoidal FM with peak deviation df and modulating frequency fm: the index beta = df/fm, Carson's bandwidth 2(df + fm), the carrier and n-th sideband amplitudes J0(beta), Jn(beta) (relative to the unmodulated carrier) and the power fraction inside Carson's bandwidth.

B_C = 2(\Delta f + f_m),\quad s(t) = A\sum_n J_n(\beta)\cos[2\pi(f_c + n f_m)t]

Inputs

  • df peak frequency deviation [Hz]
  • fm modulating (message) frequency [Hz]
  • n sideband number (default 1) integer optional

Returns

  • carson_bandwidth Carson's rule bandwidth 2(df + fm) [Hz]
  • beta modulation index df/fm
  • carrier carrier amplitude J0(beta)
  • Jn amplitude of each n-th sideband Jn(beta)
  • pair_power power fraction in the pair of n-th sidebands
  • power_in_carson power fraction within Carson's bandwidth

Applies when

  • sinusoidal message
  • beta <= 100

Example

m.ask("An FM signal has a peak frequency deviation of 75 kHz and a modulating frequency of 15 kHz. Find the Carson bandwidth.")
→ carson_bandwidth = 180000 Hz, beta = 5, carrier = -0.177597, Jn = -0.327579, pair_power = 0.214616, power_in_carson = 0.993559
Power in an AM (DSB full-carrier) signalam_power

Total power Pc (1 + m^2/2), sideband power, power per sideband and transmission efficiency of an AM signal with carrier power Pc and modulation index m (sinusoidal message).

P_t = P_c\left(1 + \frac{m^2}{2}\right)

Inputs

  • Pc carrier power [W]
  • m modulation index (0 < m <= 1)

Returns

  • Pt total transmitted power [W]
  • Psb power in both sidebands [W]
  • Pusb power in one sideband [W]
  • efficiency fraction of the power in the sidebands

Applies when

  • 0 < m <= 1
  • a single sinusoidal message

Example

m.ask("An AM transmitter has a carrier power of 1000 W and a modulation index of 0.8. What is the total transmitted power?")
→ Pt = 1320 W, Psb = 320 W, Pusb = 160 W, efficiency = 0.242424

Noise and link budgets 3

Free-space path lossfree_space_path_loss

The loss (4 pi d f / c)^2 between isotropic antennas a distance d apart at frequency f, in dB and as a ratio.

L_{\mathrm{fs}} = \left(\frac{4\pi d f}{c}\right)^2

Inputs

  • d distance [m]
  • f frequency [Hz]

Returns

  • loss_db free-space path loss in dB
  • loss path loss as a power ratio
  • wavelength wavelength [m]

Applies when

  • free space, line of sight
  • far field (d >= one wavelength)
  • isotropic antennas

Example

m.ask("What is the free-space path loss at 2.4 GHz over a distance of 100 m?")
→ loss_db = 80.052, loss = 1.01205e+08, wavelength = 0.124914 m
Noise figure of cascaded stages (Friis formula)noise_figure_cascade

The overall noise figure, noise factor, equivalent noise temperature and gain of a chain of matched stages with given noise figures and gains.

F = F_1 + \frac{F_2 - 1}{G_1} + \frac{F_3 - 1}{G_1 G_2} + \cdots

Inputs

  • nf_db noise figure of each stage in dB, input first vector
  • gain_db available gain of each stage in dB vector

Returns

  • nf_db overall noise figure in dB
  • F overall noise factor
  • Te equivalent input noise temperature [K]
  • gain_db overall gain in dB

Applies when

  • impedance-matched stages
  • noise figures referred to T0 = 290 K
  • one gain per stage

Example

m.ask("Find the overall noise figure of a cascade with noise figures [2, 6, 10] dB and gains [15, 20, 10] dB.")
→ nf_db = 2.25828, F = 1.68201, Te = 197.783 K, gain_db = 45
Received power of a radio link (Friis transmission equation)friis_received_power

The power received over a free-space link: Pr = Pt Gt Gr (lambda / 4 pi d)^2, in dBm and watts.

P_r = P_t G_t G_r \left(\frac{\lambda}{4\pi d}\right)^2

Inputs

  • Pt transmit power [W]
  • Gt_db transmit antenna gain in dBi
  • Gr_db receive antenna gain in dBi
  • f frequency [Hz]
  • d distance [m]

Returns

  • Pr_dbm received power in dBm
  • Pr received power [W]

Applies when

  • free space, line of sight
  • far field
  • matched, co-polarized antennas

Example

m.ask("Find the received power for a transmit power of 1 W, a transmit antenna gain of 10 dBi, a receive antenna gain of 5 dBi, a frequency of 2.4 GHz and a distance of 1 km.")
→ Pr_dbm = -55.052, Pr = 3.12463e-09 W

Radar 3

Doppler shift of a radar echoradar_doppler

The two-way Doppler shift of the echo from a target closing at radial velocity v (negative when receding): fd = 2 v f / (c - v), essentially 2 v / lambda.

f_d = \frac{2vf}{c - v} \approx \frac{2v}{\lambda}

Inputs

  • v radial velocity, positive when approaching [m/s]
  • f transmitted frequency [Hz]

Returns

  • fd Doppler shift of the echo [Hz]
  • wavelength wavelength [m]

Applies when

  • monostatic radar
  • |v| much smaller than c

Example

m.ask("A 10 GHz radar sees a target approaching at 30 m/s. What is the Doppler shift?")
→ fd = 2001.38 Hz, wavelength = 0.0299792 m
Maximum detection range of a radarradar_max_range

The largest range R = (Pt G^2 lambda^2 sigma / ((4 pi)^3 Smin))^(1/4) at which the echo still reaches the minimum detectable signal.

R_{\max} = \left(\frac{P_t G^2 \lambda^2 \sigma}{(4\pi)^3 S_{\min}}\right)^{1/4}

Inputs

  • Pt peak transmit power [W]
  • G_db antenna gain in dBi
  • f frequency [Hz]
  • sigma radar cross-section [m^2]
  • Pmin minimum detectable signal power [W]

Returns

  • Rmax maximum detection range [m]

Applies when

  • monostatic radar
  • free space, no losses

Example

m.ask("What is the maximum range of a radar with a peak power of 1 MW, an antenna gain of 40 dBi, a frequency of 3 GHz, a radar cross-section of 1 m^2 and a minimum detectable signal of 1e-13 W?")
→ Rmax = 266344 m
Received echo power (radar range equation)radar_received_power

The echo power Pr = Pt G^2 lambda^2 sigma / ((4 pi)^3 R^4) of a monostatic radar from a target of cross-section sigma at range R.

P_r = \frac{P_t G^2 \lambda^2 \sigma}{(4\pi)^3 R^4}

Inputs

  • Pt peak transmit power [W]
  • G_db antenna gain in dBi (transmit and receive)
  • f frequency [Hz]
  • sigma radar cross-section [m^2]
  • R range to the target [m]

Returns

  • Pr received echo power [W]
  • Pr_dbm received echo power in dBm

Applies when

  • monostatic radar, one antenna
  • free space, no losses
  • far field

Example

m.ask("A radar with a peak power of 1 MW and an antenna gain of 40 dBi operates at 3 GHz. What is the received echo power from a target with a radar cross-section of 1 m^2 at a range of 100 km?")
→ Pr = 5.03233e-12 W, Pr_dbm = -82.9823

Sampling and signal basics 7

Alias (apparent) frequency after samplingalias_frequency

The frequency in [0, fs/2] at which a sinusoid of frequency f appears after sampling at rate fs.

f_a = \left| f - f_s\,\mathrm{round}(f/f_s) \right|

Inputs

  • f frequency of the sampled sinusoid [Hz]
  • fs sampling rate [Hz]

Returns

  • f_alias apparent (principal alias) frequency [Hz]

Applies when

  • f >= 0
  • fs > 0

Example

m.ask("A 7 kHz tone is sampled at 10 kHz. What is the alias frequency?")
→ f_alias = 3000 Hz
Frequency and angular frequency from periodfrequency_from_period

The frequency f = 1/T and the angular frequency omega = 2*pi/T of a periodic signal of period T.

f = \frac{1}{T},\quad \omega = \frac{2\pi}{T}

Inputs

  • T period of the signal [s]

Returns

  • f frequency [Hz]
  • omega angular frequency [rad/s]

Applies when

  • T > 0

Example

m.ask("What is the frequency of a signal with a period of 2 ms?")
→ f = 500 Hz, omega = 3141.59 rad/s
Mean, RMS, energy and average power of a sampled signalsignal_statistics

For samples x[0..N-1]: the mean, the RMS value, the energy sum |x|^2 and the average power (energy / N).

E = \sum_n |x[n]|^2,\quad P = \frac{E}{N},\quad x_{\mathrm{rms}} = \sqrt{P}

Inputs

  • x samples of the signal vector

Returns

  • rms root-mean-square value
  • mean mean (DC) value
  • energy energy: sum of x[n]^2
  • power average power: energy / N
  • peak peak absolute value

Applies when

  • at least one sample

Example

m.ask("Find the energy, average power and RMS value of the signal x = [1, -2, 3, 0].")
→ mean = 0.5, rms = 1.87083, energy = 14, power = 3.5, peak = 3
Nyquist ratenyquist_rate

The minimum sampling rate 2*f_max that avoids aliasing of a baseband signal whose highest frequency is f_max.

f_{s,\min} = 2 f_{\max}

Inputs

  • fmax highest frequency in the signal [Hz]

Returns

  • fs_min Nyquist rate (minimum sampling rate) [Hz]
  • Ts_max longest sampling interval [s]

Applies when

  • fmax > 0
  • a baseband (lowpass) signal

Example

m.ask("What is the Nyquist rate for a signal with a maximum frequency of 4 kHz?")
→ fs_min = 8000 Hz, Ts_max = 0.000125 s
Period and angular frequency from frequencyperiod_from_frequency

The period T = 1/f and the angular frequency omega = 2*pi*f of a periodic signal of frequency f.

T = \frac{1}{f},\quad \omega = 2\pi f

Inputs

  • f frequency of the signal [Hz]

Returns

  • T period [s]
  • omega angular frequency [rad/s]

Applies when

  • f > 0

Example

m.ask("What is the period of a signal with a frequency of 50 Hz?")
→ T = 0.02 s, omega = 314.159 rad/s
RMS, peak-to-peak and rectified average of a sine wavesine_rms

For a sinusoid of peak amplitude Vp: the RMS value Vp/sqrt(2), the peak-to-peak value 2*Vp and the average of its absolute value 2*Vp/pi.

V_{\mathrm{rms}} = \frac{V_p}{\sqrt{2}}

Inputs

  • Vp peak amplitude of the sinusoid [V]

Returns

  • Vrms RMS value [V]
  • Vpp peak-to-peak value [V]
  • Vavg average of the rectified wave [V]

Applies when

  • Vp > 0
  • a pure sinusoid with no DC offset

Example

m.ask("What is the RMS value of a sine wave with a peak voltage of 10 V?")
→ Vrms = 7.07107 V, Vpp = 20 V, Vavg = 6.3662 V
Signal-to-quantization-noise ratio of an ideal ADCquantization_snr

The SQNR of an ideal N-bit uniform quantizer driven by a full-scale sine wave (about 6.02 N + 1.76 dB).

\mathrm{SQNR} = 10\log_{10}\!\left(\tfrac{3}{2}\,2^{2N}\right) \approx 6.02N + 1.76\ \mathrm{dB}

Inputs

  • bits resolution in bits integer

Returns

  • sqnr_db signal-to-quantization-noise ratio in dB
  • dynamic_range_db ideal dynamic range 20 log10(2^N) in dB

Applies when

  • ideal uniform quantizer
  • full-scale sinusoidal input
  • noise uniformly distributed

Example

m.ask("What is the signal-to-quantization-noise ratio of an ideal 12-bit ADC?")
→ sqnr_db = 74.0081, dynamic_range_db = 72.2472

Transmission lines 6

Characteristic impedance of a coaxial linecoax_impedance

The characteristic impedance (eta0 / (2 pi sqrt(er))) ln(D/d) of a lossless coaxial line and its velocity factor 1/sqrt(er).

Z_0 = \frac{\eta_0}{2\pi\sqrt{\varepsilon_r}}\ln\frac{D}{d}

Inputs

  • D inner diameter of the outer conductor [m]
  • d diameter of the inner conductor [m]
  • er relative permittivity of the dielectric (1 if not given) optional

Returns

  • Z0 characteristic impedance [ohm]
  • vf velocity factor

Applies when

  • d < D
  • er >= 1
  • lossless conductors and dielectric

Example

m.ask("What is the characteristic impedance of a coaxial cable with an inner conductor diameter of 1 mm, an outer conductor diameter of 3.5 mm and a dielectric constant of 2.25?")
→ Z0 = 50.0759 ohm, vf = 0.666667
Input impedance of a terminated lossless lineinput_impedance

The impedance seen at the input of a lossless line of characteristic impedance Z0 and electrical length l (in wavelengths) terminated in ZL = RL + jXL.

Z_{in} = Z_0\frac{Z_L + jZ_0\tan\beta l}{Z_0 + jZ_L\tan\beta l}

Inputs

  • RL load resistance [ohm]
  • Z0 characteristic impedance [ohm]
  • length line length in wavelengths
  • XL load reactance (0 if not given) [ohm] optional

Returns

  • Rin input resistance [ohm]
  • Xin input reactance [ohm]
  • abs_zin |Zin| [ohm]

Applies when

  • lossless line
  • RL > 0
  • length >= 0 in wavelengths

Example

m.ask("What is the input impedance of a 0.125 wavelength 50 ohm line terminated in a load of 100 + j0 ohm?")
→ Rin = 40 ohm, Xin = -30 ohm, abs_zin = 50 ohm
Quarter-wave impedance transformerquarter_wave_transformer

The characteristic impedance sqrt(RL Z0) of the quarter-wave section that matches a resistive load RL to a line Z0, and its physical length at frequency f.

Z_t = \sqrt{R_L Z_0},\quad \ell = \frac{v_f\,c}{4f}

Inputs

  • RL load resistance [ohm]
  • Z0 impedance to match to [ohm]
  • f design frequency [Hz] optional
  • vf velocity factor of the section (default 1) optional

Returns

  • Zt characteristic impedance of the transformer [ohm]
  • length physical length of the section (f given) [m]

Applies when

  • resistive load
  • lossless lines
  • exact match at the design frequency only

Example

m.ask("Design a quarter-wave transformer to match a 100 ohm load to a 50 ohm line at 1 GHz.")
→ Zt = 70.7107 ohm, length = 0.0749481 m
Reflection coefficient and return loss from the VSWRreflection_from_vswr

The reflection coefficient magnitude (VSWR - 1)/(VSWR + 1), the return loss and the mismatch loss for a given VSWR.

|\Gamma| = \frac{\mathrm{VSWR} - 1}{\mathrm{VSWR} + 1}

Inputs

  • vswr voltage standing wave ratio (>= 1)

Returns

  • gamma |Gamma|
  • return_loss_db return loss in dB
  • mismatch_loss_db mismatch loss in dB

Applies when

  • VSWR >= 1

Example

m.ask("What reflection coefficient and return loss correspond to a VSWR of 2?")
→ gamma = 0.333333, return_loss_db = 9.54243, mismatch_loss_db = 0.511525
Reflection coefficient, VSWR and return loss of a loadreflection_coefficient

For a load ZL = RL + jXL on a line of characteristic impedance Z0: the reflection coefficient (magnitude, angle, parts), VSWR, return loss and mismatch loss.

\Gamma = \frac{Z_L - Z_0}{Z_L + Z_0},\quad \mathrm{VSWR} = \frac{1 + |\Gamma|}{1 - |\Gamma|}

Inputs

  • RL load resistance [ohm]
  • Z0 characteristic impedance of the line [ohm]
  • XL load reactance (0 if not given) [ohm] optional

Returns

  • gamma_mag |Gamma|
  • gamma_angle_deg angle of Gamma in degrees
  • gamma_re real part of Gamma
  • gamma_im imaginary part of Gamma
  • vswr voltage standing wave ratio
  • return_loss_db return loss in dB
  • mismatch_loss_db mismatch loss in dB

Applies when

  • RL > 0
  • Z0 real (lossless line)

Example

m.ask("A 50 ohm line is terminated in a load of 75 + j25 ohm. Find the reflection coefficient and the VSWR.")
→ gamma_mag = 0.27735, gamma_angle_deg = 33.6901, gamma_re = 0.230769, gamma_im = 0.153846, vswr = 1.76759, return_loss_db = 11.1394, mismatch_loss_db = 0.347621
VSWR and return loss from the reflection coefficientvswr_from_reflection

The VSWR (1 + |Gamma|)/(1 - |Gamma|), the return loss -20 log10 |Gamma| and the mismatch loss from the magnitude of the reflection coefficient.

\mathrm{VSWR} = \frac{1 + |\Gamma|}{1 - |\Gamma|}

Inputs

  • gamma magnitude of the reflection coefficient (0 <= |Gamma| < 1)

Returns

  • vswr voltage standing wave ratio
  • return_loss_db return loss in dB
  • mismatch_loss_db mismatch loss in dB

Applies when

  • 0 <= |Gamma| < 1

Example

m.ask("What is the VSWR for a reflection coefficient of 0.2?")
→ vswr = 1.5, return_loss_db = 13.9794, mismatch_loss_db = 0.177288

Wavelets 2

Haar discrete wavelet transformhaar_dwt

The multi-level orthonormal Haar wavelet transform of a sequence whose length is a power of two: the final approximation and the detail coefficients of every level (coarsest first).

c_A[k] = \frac{x[2k] + x[2k+1]}{\sqrt 2},\quad c_D[k] = \frac{x[2k] - x[2k+1]}{\sqrt 2}

Inputs

  • x samples (length a power of two) vector
  • levels number of levels (default 1) integer optional

Returns

  • approximation approximation coefficients after the last level
  • details detail coefficients per level, coarsest first

Applies when

  • length a power of two
  • levels <= log2 N

Example

m.ask("Compute the 2-level Haar wavelet transform of x = [4, 6, 10, 12, 8, 6, 5, 5].")
→ approximation = [16.000000000000004, 12.000000000000002], details = [[-6.000000000000001, 2.0], [-1.4142135623730951, -1.4142135623730951, 1.4142135623730951, 0.0]]
Inverse Haar wavelet transform (one level)haar_idwt

The sequence reconstructed from one level of Haar approximation and detail coefficients.

x[2k] = \frac{c_A[k] + c_D[k]}{\sqrt 2},\quad x[2k+1] = \frac{c_A[k] - c_D[k]}{\sqrt 2}

Inputs

  • cA approximation coefficients vector
  • cD detail coefficients vector

Returns

  • x reconstructed samples

Applies when

  • equal lengths

Example

m.ask("Compute the inverse Haar transform with approximation coefficients [16, 12] and detail coefficients [-6, 2].")
→ x = [7.0710678118654755, 15.556349186104047, 9.899494936611665, 7.0710678118654755]

Windows and spectral analysis 3

Coefficients of a window functionwindow_coefficients

The samples w[0..N-1] of a rectangular, Hann, Hamming or Blackman window (symmetric for filter design, periodic for spectral analysis) and its coherent gain.

w[n] = \sum_k (-1)^k a_k \cos\frac{2\pi k n}{M}

Inputs

  • window window type choice
  • N window length integer
  • form symmetric (default) or periodic choice optional

Returns

  • w window samples w[0..N-1]
  • coherent_gain coherent gain: mean of w

Applies when

  • N >= 2

Example

m.ask("Give the coefficients of a 4-point periodic Hann window.")
→ w = [0.0, 0.49999999999999994, 1.0, 0.5000000000000001], coherent_gain = 0.5
Main-lobe width of a spectral windowwindow_mainlobe_width

The null-to-null main-lobe width of the rectangular, Hann, Hamming or Blackman window (DFT-even form), in bins and, with fs, in hertz.

\Delta f_{\mathrm{ML}} = k\,\frac{f_s}{N},\ k = 2\ (\text{rect}),\ 4\ (\text{Hann, Hamming}),\ 6\ (\text{Blackman})

Inputs

  • window window type choice
  • N window length integer
  • fs sampling rate (for the width in Hz) [Hz] optional

Returns

  • width_bins null-to-null main-lobe width in DFT bins
  • first_null_bins position of the first null in bins
  • width_hz main-lobe width in Hz (fs given) [Hz]

Applies when

  • N >= 8
  • DFT-even (periodic) windows for spectral analysis

Example

m.ask("What is the main-lobe width of a 256-point Hann window at a sampling rate of 8 kHz?")
→ width_bins = 4, first_null_bins = 2, width_hz = 125 Hz
Periodogram (power spectral density estimate)periodogram

The one-sided periodogram PSD estimate (rectangular window, mean removed) of a sequence sampled at fs, its frequency grid and the frequency of its peak.

P[k] = \frac{2\,|X[k]|^2}{f_s N}\ (0 < k < N/2)

Inputs

  • x samples vector
  • fs sampling rate [Hz]

Returns

  • peak_frequency frequency of the largest PSD value [Hz]
  • freqs frequencies k fs / N, k = 0 .. N/2
  • psd one-sided power spectral density (power per hertz)

Applies when

  • mean removed first
  • rectangular window
  • one-sided density scaling

Example

m.ask("Compute the periodogram of x = [1, 0, -1, 0, 1, 0, -1, 0] at a sampling rate of 8 Hz.")
→ peak_frequency = 2 Hz, freqs = [0.0, 1.0, 2.0, 3.0, 4.0], psd = [0.0, 0.0, 0.5, 0.0, 0.0]

Z-transform and stability 2

Poles and stability of a second-order all-pole systemsecond_order_poles

The poles of H(z) = 1/(1 + a1 z^-1 + a2 z^-2) (roots of z^2 + a1 z + a2), their largest radius and whether the causal system is stable.

z^2 + a_1 z + a_2 = 0,\quad \text{stable} \iff |p_i| < 1

Inputs

  • a1 coefficient of z^-1 in the denominator
  • a2 coefficient of z^-2 in the denominator

Returns

  • radius largest pole radius |p|
  • p1 first pole (smaller real, or positive imaginary part)
  • p2 second pole
  • stability stable if every pole lies inside the unit circle

Applies when

  • a2 != 0
  • a causal system (stable iff |p| < 1 for every pole)

Example

m.ask("Find the poles of H(z) = 1/(1 - 1.2z^-1 + 0.5z^-2) and say whether the system is stable.")
→ radius = 0.707107, p1 = 0.6 + 0.374166i, p2 = 0.6 - 0.374166i, stability = stable
Poles, zeros and stability of a digital filterpoles_zeros

The zeros and poles of H(z) = sum b_k z^-k / sum a_k z^-k (up to 4th order), the largest pole radius and whether the causal filter is stable.

H(z) = \frac{\sum_k b_k z^{-k}}{\sum_k a_k z^{-k}} = \frac{b_0\prod(1 - z_i z^{-1})}{a_0\prod(1 - p_i z^{-1})}

Inputs

  • b numerator coefficients b (up to 5) vector
  • a denominator coefficients a (up to 5, a[0] != 0) vector

Returns

  • max_pole_radius largest pole radius
  • zeros zeros (real ascending, then complex)
  • poles poles (real ascending, then complex)
  • stability stable if every pole lies inside the unit circle

Applies when

  • a[0] != 0
  • orders up to 4
  • both polynomials in powers of z^-1 (padded to equal length)

Example

m.ask("Find the poles and zeros of the filter with b = [1, -1] and a = [1, -0.9].")
→ max_pole_radius = 0.9, zeros = [1.0], poles = [0.9], stability = stable
Questions

Frequently asked

What does signal-processing-ai999x do?

Signal Processing answers questions in signal processing: sampling, Fourier series and transforms, the DFT and FFT, filters, convolution, z-transforms, modulation, communication links, RF transmission lines and radar. Each answer gives the value with its unit, the steps and the formula in LaTeX.

How do I install signal-processing-ai999x?

With pip: pip install signal-processing-ai999x. The same files are on Hugging Face (hf download AI999X/signal-processing-ai999x --local-dir signal-processing-ai999x) and GitHub.

Does it run offline?

Yes. It is a Python package that runs on an ordinary CPU without a network connection (Python >=3.10); no GPU and no API key are needed.

How many capabilities does signal-processing-ai999x have?

74 capabilities in 18 topics, including Digital filters, Decibels and levels, Sampling and signal basics, Transmission lines, DFT and FFT.

Which field and tasks does it cover?

Field: Engineering. Tasks: Question Answering, Token Classification, Text Classification, Sentence Similarity, Feature Extraction.

What does an answer look like?

Asked "What is the Nyquist rate for a signal with a maximum frequency of 4 kHz?", it answers: fs_min = 8000 Hz, Ts_max = 0.000125 s.

What happens when a question cannot be answered?

It says so and names what is missing or out of range, instead of guessing a number.

More from AI999X

Explore every model.