Skip to content

Instantly share code, notes, and snippets.

@kurohuku
Created May 18, 2013 14:12
Show Gist options
  • Save kurohuku/5604539 to your computer and use it in GitHub Desktop.
Save kurohuku/5604539 to your computer and use it in GitHub Desktop.
# Octaveでチャープ信号を書く
# E(t) = E0 cos(2πfct + at^2)
# t: 時間変化
# E0: 振幅
# fc: 中心周波数
# a: チャープ定数 (a/π: チャープ率)
function fn = mkchirp(E0, fc, a)
fn = @(t) E0 * cos(2 * pi * fc * t + a * power(t, 2));
endfunction;
x = 0:0.001:1;
y = mkchirp(1, 1, 100)(x);
plot(x, y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment