You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何基于斐波那契比率生成阻尼正弦波?(Octave/Matlab环境)

实现基于斐波那契比率的阻尼正弦波(Octave 4.0)

Got it, let's break this down simply—since you already have a foundation with Fibonacci ratio plots, adapting to a damped sine wave just means tying the key damping/oscillation parameters to Fibonacci constants (like the golden ratio φ ≈1.618 or its reciprocal ψ≈0.618).

Core Concept

A standard damped sine wave follows this formula:

y(t) = A₀ * e^(-λ*t) * sin(ω*t + φ₀)

We’ll map Fibonacci ratios to:

  • Damping coefficient (λ): Use ψ (1/φ ≈0.618) for natural, golden-ratio-based decay
  • Oscillation frequency (ω): Use φ itself to tie the wave’s cycle to the golden ratio
  • Amplitude envelope: Let the upper/lower bounds decay using Fibonacci ratios too

Step-by-Step Implementation Code

Here’s a complete example that you can tweak to match your target waveform:

% 1. Calculate Fibonacci (Golden Ratio) constants
phi = (1 + sqrt(5))/2;       % ≈1.618, the golden ratio
psi = 1/phi;                 % ≈0.618, reciprocal of phi (ideal for damping)

% 2. Define time range and base parameters
t = linspace(0, 10, 1000);   % Time from 0 to 10s, 1000 sample points
A0 = 10;                     % Initial amplitude
omega = phi;                 % Oscillation frequency tied to golden ratio
phi0 = 0;                    % Phase shift (adjust if needed)

% 3. Generate the damped sine wave with Fibonacci ratios
y = A0 * exp(-psi * t) .* sin(omega * t + phi0);

% Optional: Add Fibonacci-based envelope lines (matches typical target waveforms)
upper_envelope = A0 * exp(-psi * t);
lower_envelope = -upper_envelope;

% 4. Plot the result
figure('Color','white');
plot(t, y, 'b-', 'LineWidth', 1.5);
hold on;
plot(t, upper_envelope, 'r--', 'LineWidth', 1);
plot(t, lower_envelope, 'r--', 'LineWidth', 1);

% Format the plot for clarity
xlabel('Time (s)');
ylabel('Amplitude');
title('Damped Sine Wave with Fibonacci Ratio Damping & Frequency');
legend('Damped Sine Wave', 'Golden Ratio Decay Envelope', 'Location','best');
grid on;

Customization Tips (Match Your Target Waveform)

If your target has specific behaviors (like segmented damping or frequency shifts tied to Fibonacci sequences), adjust these parts:

  • Segmented damping: Use a Fibonacci sequence to change the damping coefficient over time (e.g., fib = [1,1,2,3,5,8]; then loop through segments with lambda = fib(i)/phi)
  • Amplitude decay tied to Fibonacci terms: Replace the exponential decay with a stepwise decay using Fibonacci reciprocals (e.g., A(t) = A0 ./ fib_segment)
  • Frequency modulation: Make omega increase/decrease using Fibonacci ratios (e.g., omega = phi * t for accelerating oscillation)

Example of Segmented Fibonacci Damping

If you want the damping to change based on consecutive Fibonacci ratios:

fib = [1,1,2,3,5,8,13];               % Fibonacci sequence
fib_ratios = fib(2:end)./fib(1:end-1); % Ratios between consecutive terms (approaches phi)
t_segments = linspace(0,10,length(fib_ratios)+1);
y = [];

for i = 1:length(fib_ratios)
    t_segment = linspace(t_segments(i), t_segments(i+1), 100);
    damping = fib_ratios(i)/phi;       % Normalize ratio to psi range
    y_segment = A0 * exp(-damping * t_segment) .* sin(phi * t_segment);
    y = [y, y_segment];
end

figure('Color','white');
plot(linspace(0,10,length(y)), y, 'b-', 'LineWidth',1.5);
title('Damped Sine Wave with Segmented Fibonacci Ratio Damping');
xlabel('Time (s)');
ylabel('Amplitude');
grid on;

内容的提问来源于stack exchange,提问作者Rick T

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 07:40:06