Change sound clips from audible to ultrasonic range
    6 次查看(过去 30 天)
  
       显示 更早的评论
    
I have sound clips that are about 3-4 seconds in human audible range. I want to convert them into ultrasonic range so that when I transmit them they are not audible to humans. I read that I need to use amplitude modulation. I used the modulate function of matlab.
[y,Fs] = audioread('TakeASelfie.mp3');
x = modulate(y,30700, 62000, 'am');
soundsc(x,62000)
audiowrite('modulated.wav', x, 62000)
In the above example, I was trying to convert my audio clip to 30.7kHz. However, after I performed modulation, the length of the clip was decreased. How can I change the frequency of my sound clip without changing the length of it? Thank you.
0 个评论
回答(1 个)
  Mark Schwab
    
 2018-1-26
        The behavior that you are experiencing is not expected. I tried reproducing this on my machine and the size of the signal remained the same after modulation. You can test this out by running the following code
 load handel;
 x = modulate(y,1000,Fs,'am');
 audiowrite('tmp.wav',x,Fs)
I tried distorting the data of my signal by adding NaNs or infs to y but this still returned a signal of the same length as the original. Can you provide your .mp3 file?
0 个评论
另请参阅
类别
				在 Help Center 和 File Exchange 中查找有关 Audio I/O and Waveform Generation 的更多信息
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

