Skip to content

Commit

Permalink
fix(dsp): allow sps=1 in upconvert
Browse files Browse the repository at this point in the history
  • Loading branch information
mchitre committed Dec 9, 2024
1 parent 044cbb6 commit 15cc7eb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/dsp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@ Converts baseband signal with `sps` symbols per passband sample to a real
passband signal centered around carrier frequency `fc`.
"""
function upconvert(s::AbstractVector, sps, fc, pulseshape=rrcosfir(0.25, sps); fs=framerate(s))
pad = cld(length(pulseshape), 2*sps) - 1
s = vcat(zeros(pad), complex.(s), zeros(pad))
s = signal(resample(s, sps, pulseshape), sps*fs)
if sps != 1
pad = cld(length(pulseshape), 2*sps) - 1
s = vcat(zeros(pad), complex.(s), zeros(pad))
s = signal(resample(s, sps, pulseshape), sps*fs)
end
2 * real.(s .* cis.(2π * inHz(fc) * domain(s)))
end

Expand Down

0 comments on commit 15cc7eb

Please sign in to comment.