Signal processing

SignalAnalysis.circconvFunction
circconv(x)
circconv(x, y)

Computes the circular convolution of x and y. Both vectors must be the same length.

SignalAnalysis.demonMethod
demon(x; fs, downsample, method, cutoff)

Estimates DEMON spectrum. The output is highpass filtered with a cutoff frequency and downsampled. Supported downsampling methods are :rms (default), :mean and :fir.

SignalAnalysis.downconvertFunction
downconvert(s, sps, fc)
downconvert(s, sps, fc, pulseshape; fs)

Converts passband signal centered around carrier frequency fc to baseband, and downsamples it by a factor of sps. If the pulseshape is specified to be nothing, downsampling is performed without filtering.

SignalAnalysis.firFunction
fir(n, f1)
fir(n, f1, f2; fs, method)

Designs a n-tap FIR filter with a passband from f1 to f2 using the specified method. If frame rate fs is not specified, f1 and f2 are given in normalized units (1.0 being Nyquist). If f1 is 0, the designed filter is a lowpass filter, and if f2 is nothing then it is a highpass filter.

This method is a convenience wrapper around DSP.digitalfilter.

Examples:

julia> lpf = fir(127, 0, 10kHz; fs=44.1kHz)   # design a lowpass filter
127-element Array{Float64,1}:
  ⋮

julia> hpf = fir(127, 10kHz; fs=44.1kHz)      # design a highpass filter
127-element Array{Float64,1}:
  ⋮

julia> bpf = fir(127, 1kHz, 5kHz; fs=44.1kHz) # design a bandpass filter
127-element Array{Float64,1}:
  ⋮
SignalAnalysis.gmseqFunction
gmseq(m)
gmseq(m, θ)

Generates an generalized m-sequence of length 2^m-1 or tap specification m.

Generalized m-sequences are related to m-sequences but have an additional parameter θ. When θ = π/2, generalized m-sequences become normal m-sequences. When θ < π/2, generalized m-sequences contain a DC-component that leads to an exalted carrier after modulation. When θ is atan(√(2^m-1)), the m-sequence is considered to be period matched. Period matched m-sequences are complex sequences with perfect discrete periodic auto-correlation properties, i.e., all non-zero lag periodic auto-correlations are zero. The zero-lag autocorrelation is 2^m-1, where m is the shift register length.

This function currently supports shift register lengths between 2 and 30.

Examples:

julia> x = gmseq(3)         # generate period matched m-sequence
7-element Array{Complex{Float64},1}:
 0.3535533905932738 + 0.9354143466934853im
 0.3535533905932738 + 0.9354143466934853im
 0.3535533905932738 + 0.9354143466934853im
 0.3535533905932738 - 0.9354143466934853im
 0.3535533905932738 + 0.9354143466934853im
 0.3535533905932738 - 0.9354143466934853im
 0.3535533905932738 - 0.9354143466934853im

julia> x = gmseq(3, π/4)    # generate m-sequence with exalted carrier
7-element Array{Complex{Float64},1}:
 0.7071067811865476 + 0.7071067811865475im
 0.7071067811865476 + 0.7071067811865475im
 0.7071067811865476 + 0.7071067811865475im
 0.7071067811865476 - 0.7071067811865475im
 0.7071067811865476 + 0.7071067811865475im
 0.7071067811865476 - 0.7071067811865475im
 0.7071067811865476 - 0.7071067811865475im
SignalAnalysis.goertzelMethod
goertzel(x, f, n; fs)

Detects frequency f in input signal using the Goertzel algorithm.

The detection metric returned by this function is the complex output of the Goertzel filter at the end of the input block. Typically, you would want to compare the magnitude of this output with a threshold to detect a frequency.

When a block size n is specified, the Goertzel algorithm in applied to blocks of data from the original time series.

SignalAnalysis.mseqFunction
mseq(m)
mseq(m, θ)

Generates an m-sequence of length 2^m-1 or tap specification m.

m-sequences are sequences of +1/-1 values with near-perfect discrete periodic auto-correlation properties. All non-zero lag periodic auto-correlations are -1. The zero-lag autocorrelation is 2^m-1, where m is the shift register length.

This function currently supports shift register lengths between 2 and 30.

Examples:

julia> x = mseq(3)                  # generate regular m-sequence
7-element Array{Float64,1}:
  1.0
  1.0
  1.0
 -1.0
  1.0
 -1.0
 -1.0

julia> x = mseq((1,3))              # generate m-sequence with specification (1,3)
7-element Array{Float64,1}:
  1.0
  1.0
  1.0
 -1.0
  1.0
 -1.0
 -1.0
SignalAnalysis.pllFunction
pll(x)
pll(x, bandwidth; fs)

Phased-lock loop to track dominant carrier frequency in input signal.

SignalAnalysis.removedc!Method
removedc!(s; α)

DC removal filter. Parameter α controls the cutoff frequency. Implementation based on Lyons 2011 (3rd ed) real-time DC removal filter in Fig. 13-62(d).

See also: removedc

SignalAnalysis.removedcMethod
removedc(s; α)

DC removal filter. Parameter α controls the cutoff frequency. Implementation based on Lyons 2011 (3rd ed) real-time DC removal filter in Fig. 13-62(d).

See also: removedc!

SignalAnalysis.upconvertFunction
upconvert(s, sps, fc)
upconvert(s, sps, fc, pulseshape; fs)

Converts baseband signal with sps symbols per passband sample to a real passband signal centered around carrier frequency fc.