Skip to content

Commit

Permalink
refactor: Update AC signal calculation to include amplitude parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
ulises-jeremias committed Jun 9, 2024
1 parent 60954e6 commit 03d80c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/script_mode_ac_signal/main.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ beta := 0.5 // rad
a0 := 10 // V

t := util.lin_space(0, 2 * (1 / f), 150) // 2 periods
y := t.map(math.sin(2 * math.pi * f * it + beta)) // AC signal: y = A₀·sin(2πft + β)
y := t.map(a0 * math.sin(2 * math.pi * f * it + beta)) // AC signal: y = A₀·sin(2πft + β)

mut plt := plot.Plot.new()

Expand Down

0 comments on commit 03d80c8

Please sign in to comment.