MATLAB除了生孩子,其他全都能做系列。

使用MATLAB进行播放《追光者》,纯文本内容哦。

1 Fs = 8192;
2 load y;
3 sound(y, Fs);

加载的y是哪里来的呢?当然是调用函数生成的咯。

function y = gen_wave(tone, rythm, type)
    Fs = 8192;
    freqs = [261, 293, 329, 349, 392, 440, 494, 523, 587, 659, 698, 783, 880, 988, 1046, 1174, 0];
    x = linspace(0, 2 * pi * rythm, floor(Fs * rythm));
    if type == 1
        y = sin(freqs(tone) * x);
    else
        y = sin(freqs(tone) * x) .* (1 - x / (2 * pi * rythm));
    end
end

y中的内容就不展示了,全是数据。

链接:!!!!!

链接:https://pan.baidu.com/s/1NPh4SaAJZ3ZMiN2M98vL6g
提取码:8qpu

相关文章:

  • 2021-12-08
  • 2021-08-31
  • 2021-04-12
  • 2021-12-20
  • 2021-07-07
  • 2021-11-21
  • 2021-05-18
  • 2022-01-15
猜你喜欢
  • 2021-07-20
  • 2022-01-30
  • 2022-12-23
  • 2021-05-23
  • 2021-12-13
  • 2021-12-29
相关资源
相似解决方案