1 year ago

#252423

test-img

daniel

Save and play pure 20kHz signals (sound) [MATLAB]

I'm trying to save (as .WAV) and play 20kHz pure signals (short and long signals) but as I see at the visualizer, I didn't receive what I really need.

As you can see this is the WAV file inspection, I send 20kHz but there are more noises below.

Also, I use a 20kHz dedicated speaker and when I transmit the 20kHz I hear ticks that I don't want to hear (maybe because of the noises or because of the sin signal that i send wrong)

The spectrogram that is attached to the post is the pure WAV file that I write the sin signals in there, before the transmission (via special speaker)

enter image description here

  1. At the lower frequency, I still receive these noises

  2. I want 20kHz in purpose, I know that I can't hear this frequency so because of this I use a special microphone and speaker (+with spectrogram) to inspect what I transmit. I just don't understand why I receive these noises below the frequency that I transmit, maybe it's because I sending the 'sin' signal like this?

freq=20000;                                                                
time=3000;                                                                 
Fs=48000; 
                                                               
timevec = (0:1/Fs:time-(1/Fs));                                            
short = sin(2*pi*freq*timevec(1:7000));                                  
long = sin(2*pi*freq*timevec(1:20000));   
                                 
%%
%.
%.
%Here i put the signals in array to send them at the order that i want
%.
%.
%%

pp = audioplayer(array,Fs);                                                  
play(pp);                                                                  
filename = 'sound.wav';                                                    
audiowrite(filename,array,Fs);  

matlab

audio

wav

frequency

speaker

0 Answers

Your Answer

Accepted video resources