我有大约3-4秒的声音片段,在人的听觉范围内。我想把它们转换成超声波范围,这样当我传输它们时,人类就听不到它们了。我读到我需要使用调幅。我使用了matlab的调制函数。
[y,Fs] = audioread('TakeASelfie.mp3');
x = modulate(y,30700, 62000, 'amdsb-tc');
soundsc(x,62000)
audiowrite('modulated.wav', x, 62000)在上面的例子中,我试图将我的音频片段转换为30.7 the。然而,在我执行了调制之后,剪辑的长度减少了。如何在不更改声音剪辑长度的情况下更改其频率?我也不确定我所采取的方法是否正确。
发布于 2018-02-19 14:37:43
一种方法(此方法将为您提供较低的边带,例如,如果您的音频信号具有20000至2000HZ的频谱和载波频率f0 = 40000 Hz,则您的超声信号将具有39800至38000 Yz的频谱):
fs=96000; % samplig frequency (should be at least x2.2 of f0 )
[sb, fd]=wavread('as4.wav'); % signal in audio domain
if fd ~= fs % change sampling prequency to target
sb = resample(sb, fs, fd);
end
sb=sb./max(sb); % normalization
A = 1; % amplitude of carrier tone
T = length(sb) / fs; % length of signal
f0 = 40000; % carrier frequency
Fi0 = pi/2; % initial phase
N = T * fs; % number of samples
t = (0 : N-1) / fs; % time stamps
sa = A * sin(2 * pi * f0 * t + Fi0); % samples of carrier tone
% first method
s = sb .* sa + imag(hilbert(sb)) .* imag(hilbert(sa));
% to have upper sideband use
% s = sb .* sa - imag(hilbert(sb)) .* imag(hilbert(sa));
% second method
s = ssbmod(sb, f0, fs);
s=s./(max(s)); % normalization of modulated signalhttps://stackoverflow.com/questions/48436756
复制相似问题