首页 > 行业资讯 > 【信号处理】基于matlab模拟电音合成器附GUI

【信号处理】基于matlab模拟电音合成器附GUI

时间:2022-05-13 来源: 浏览:

【信号处理】基于matlab模拟电音合成器附GUI

天天Matlab 天天Matlab
天天Matlab

TT_Matlab

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,完整matlab代码或者程序定制加qq1575304183。

收录于合集 #信号处理应用matlab源码 205个

1 简介

基于matlab模拟电音合成器

2 部分代码

function [PR,t,nn] = piano_roll(Notes,vel,ts) % % Inputs: % Notes: 从 midiInfo.m 返回的音符矩阵(N*8) % vel: (可选) 若vel==1, set value to note velocity instead of 1. (默认 0) % ts: (可选) time step of one ’pixel’ 以秒为单位 (默认 0.01) % % Outputs: % PR: PR(ni,ti): 在音符编号为ni,时刻编号为ti处()的取值,只能取0/1 % 行数——音符数;列数——时刻标记数 % t: t(ti): 时刻编号为ti的时刻(以秒为单位) % nn: nn(ni): note number at note index ti % % (i.e. t and nn provide ’real-world units’ for PR) % % Copyright (c) 2009 Ken Schutte % more info at: http://www.kenschutte.com/midi if nargin < 2 vel = 0; end if nargin < 3 ts = 0.01; end Nnotes = size(Notes,1); n1 = round(Notes(:,5)/ts)+1; % start tics n2 = round(Notes(:,6)/ts)+1; % end tics if vel == 0 vals = ones(Nnotes,1); else vals = Notes(:,4); % velocity end Notes(:,3) = Notes(:,3) + (Notes(:,3)==0); % correct zeros in the tone PR = zeros(max(Notes(:,3)), max(n2)); for i=1:Nnotes PR(Notes(i,3), n1(i):n2(i)) = vals(i); end % create quantized time axis: t = linspace(0,max(Notes(:,6)),size(PR,2)); % note axis: nn = min(Notes(:,3)):max(Notes(:,3)); % truncate to notes used: PR = PR(nn,:);

3 仿真结果

4 参考文献

[1]孙慧霞, 周上楠, 周玲,等. 基于MATLAB GUI的数字信号处理仿真平台开发[J]. 电子科技, 2021.

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。

版权:如无特殊注明,文章转载自网络,侵权请联系cnmhg168#163.com删除!文件均为网友上传,仅供研究和学习使用,务必24小时内删除。
相关推荐