创建一个平衡的双向脉冲对,也称为 Lilly Wave 并在八度/matlab 中更改其样本量

Creating a balanced bidirectional pulse pair, also called the Lilly Wave and change it's sample amounts in octave / matlab

您好,我正在尝试创建一个双向脉冲对,或者使用类似于 matlab 的 Octave 3.8.1 的 Lilly Wave(Lilly wave)。

这就是我发现的 Lilly wave Lilly wave

The previous wave forms used in neurophysiology and in neurosurgery injured the neurons when unidirectional current passed through the brain. Dr. Lilly developed a new electrical wave form to balance the current, first in one direction and then, after a brief interval, in the other. Thus ions moving in the neurons would first be pushed one way and then quickly the other way, stimulating the neurons and leaving the ions in their former positions within the neurons. This new wave form was called a balanced bidirectional pulse pair, or the Lilly Wave. Microscopic studies of brains stimulated with this balanced pulse pair showed that there was no injury of the neuronal networks from this kind Waveform of stimulating current: pulse pairs of current resulting from quasi-differentiation, with passive electrical elements, of a rectangular pulse. Measured at 2 percent of the peak, the duration of the positive pulse (upward) is 34 sec, and the duration of the negative pulse (downward) is 28 sec. stimulation.

我有两个问题: 1) 这是创建 "lilly wave" 以导出到音频源的最佳方式吗? 2) 如何让信号成为 44100 个样本而不是 154350 个样本。

代码如下:

clear all
graphics_toolkit gnuplot %use this for now it's older but allows zoom
figure
clf
% SCRIPT BEGINS
t=linspace(0,1,44100);
freq=1; %how many in 1 sec
A = 1; % amplitude
T = 1/freq; % period of the signal

%sine wave
ysin=sin(2*pi*freq*t);

square=0*t;

lilly=[ysin(1:length(t)/2),square(1:length(t)/2),-ysin(1:length(t)/2),square,square];
figure;
plot(lilly)

这是对第 2 点的回答)。

脉冲有尾巴,像高斯

# a simple gaussian
gauss = @(t, t0, g) exp(-((t-t0)/g).^2);

# sampling
t=0:1:44100;

# pulses peak positions (s)
t1 = 10000; 
t2 = 30000; 
# pulses width (at 1/e^2) (s)
g = 2000;

lilly = gauss(t, t1, g) - gauss(t, t2, g);

plot(t, lilly)

产生