⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pitchshiftdelaylinemodulation.m

📁 matlab code, discrete time processing vverlap and add example
💻 M
字号:
% Pitch shift delay line modulation 

close all
clear all

BLen = 1024; %block length
freq_sawtooth=-30; %pitch change variable (negative rases pitch)
Width=0.01;

[x,fs,bit]=wavread('Brass_Jazz.wav');

% creating the window
ind = (1:length(x))'*2*pi/BLen;
Wa =(1-cos(ind))/2;

%plot(w)

% makes 2 copies of input file
An=x(1:length(x));
Bn=x(1+BLen/2:length(x));

% applies varring delay
An_y=Delayline(An,fs,freq_sawtooth,Width,BLen);
Bn_y=Delayline(Bn,fs,freq_sawtooth,Width,BLen);
    
% applies windowing to modified input
An_Win=An_y.*Wa(1:length(An_y));
Bn_Win=Bn_y.*Wa(1:length(Bn_y));

% stores modifed input in buffer
y_a=An_Win;
y_b=[1,length(x)]*0;
y_b(1+BLen/2:length(x))=Bn_Win;

% combines the two buffers 
y=y_a+y_b';

%wavwrite(y,fs,'7_4_3_DelayLine_HIGH.wav');
%wavwrite(y,fs,'7_4_3_DelayLine_LOW.wav');


% figure
% plot(abs(fft(x)),'b')
% hold
% plot(abs(fft(y)),'r')
% hold off

figure (2)
plot(x,'b')
hold
plot(y,'r')
hold off

% figure
% plot(y_a)
% figure
% plot(y_b)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -