Skip to content

Commit

Permalink
Change GPU carrier_replica to StructArray, adjust the calculation method
Browse files Browse the repository at this point in the history
  • Loading branch information
Can Ozmaden committed Jun 1, 2020
1 parent 4217d83 commit ad2b607
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/carrier_replica.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,18 @@ $(SIGNATURES)
GPU carrier generation
"""
function gen_carrier_replica!(
carrier_replica::CuArray{Complex{Float32}},
carrier_replica::StructArray{Complex{Float32}},
carrier_frequency,
sample_frequency,
sampling_frequency,
start_phase,
carrier_amplitude_power,
start_sample,
num_samples
)
carrier_replica = exp.(1im * (2pi * (1:num_samples) * carrier_frequency / sample_frequency + start_phase))
z = CuArray{Complex{Float32}}(undef, num_samples)
@. z = cis(2pi * (1:num_samples) * carrier_frequency / sampling_frequency + start_phase )
carrier_replica.re .= real(z)
carrier_replica.im .= imag(z)
return carrier_replica
end

Expand Down

0 comments on commit ad2b607

Please sign in to comment.