Save and play pure 20kHz signals (sound)

7 views (last 30 days)
Hello,
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)
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);

Answers (1)

Image Analyst
Image Analyst on 1 Mar 2022
Try a lower frequency, like 10 KHz. Then see if you can hear that. Keep bumping up the frequency and see what you hear. It could be either that your speaker system really can't play that high a frequency, or that your ears can't hear it. If you have an audio frequency spectrum analyzer (like one with a microphone) then you can actually test what's coming out of the speaker, which is better than trusting your ears.
  1 Comment
daniel hoasov cohen
daniel hoasov cohen on 2 Mar 2022
Edited: daniel hoasov cohen on 4 Mar 2022
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?
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)

Sign in to comment.

Categories

Find more on Audio I/O and Waveform Generation in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!