【问题标题】:Converting audible sound to ultrasonic将可听声音转换为超声波
【发布时间】:2018-07-04 08:11:03
【问题描述】:

我有大约 3-4 秒在人类可听范围内的声音片段。我想将它们转换为超声波范围,这样当我传输它们时,它们就不会被人类听到。我读到我需要使用幅度调制。我使用了matlab的调制函数。

[y,Fs] = audioread('TakeASelfie.mp3');
x = modulate(y,30700, 62000, 'amdsb-tc');
soundsc(x,62000)
audiowrite('modulated.wav', x, 62000)

在上面的示例中,我试图将我的音频剪辑转换为 30.7kHz。但是,在我执行调制后,剪辑的长度减少了。如何在不改变长度的情况下改变声音片段的频率?我也不确定我采取的方法是否正确。

【问题讨论】:

标签: matlab audio amplitude modulation


【解决方案1】:

一种方法(此方法将为您提供较低的边带,例如,如果您的音频信号的频谱范围为 200 到 2000 Hz,载波频率 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 signal

【讨论】:

    猜你喜欢
    • 2014-02-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多