Sonar sound being recorded by Sleep Noise recording.

1,868 views
Skip to first unread message

icwiz

unread,
Jan 20, 2017, 1:45:39 PM1/20/17
to Sleep as Android
Hello,

This is my first time using Sleep as Android.  My phone is a galaxy s7 edge.  I turned on sonar to track my sleep movement and also the sleep nose recording. 

When i checked the recording the next day, it has a repeating pulse noise. Im guessing its the sonar. I could not hear the sonar, yet it seems to show up as a normal frequency pulse.

I attached a sample file. It has the pulses and a brief snore from me for reference.

Thanks 
firstsleepPulse.wav

Jiri Richter

unread,
Jan 23, 2017, 7:57:48 AM1/23/17
to Sleep as Android Googlegroup, sleep-as...@googlegroups.com

Jiri replied

Jan 23, 13:57
Hello Sleep as Android,
we have this reported, but it is device specific and we cannot reproduce this on any phone around, also we don't have a theory how this happens and how we could possible prevent it, so I can only recommend not using Sonar or sleep noise recording for the time being before we get hands on an affected phone and find a solution..

Thank you very much.

Best regards,

Jiri Richter
Urbandroid Team
Follow us: 


Sleep as Android Googlegroup sent a message

Jan 20, 19:45
--
You received this message because you are subscribed to the Google Groups "Sleep as Android" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sleep-as-an-dr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

{#HS:308009740-28753#}

Ewoud

unread,
Jan 23, 2017, 11:00:52 AM1/23/17
to Sleep as Android
My noise recording also includes a faint artifact of the sonar wave (LG v20). Might it not be related to:
- skewed frequency-sensitivity curve of the microphone that favors higher frequency soundwaves
- specific wave propagation behavior that lowers the frequency 

Some potential experiments:
- Does it occur in different spots of the applicable room and / or other rooms of the house?
- Is it possible to connect your device to external speakers for production of the sonar waves?

In this regard, Is the noise recording not set to a safe threshold, e.g. cutting off anything above a frequency that is relevant to snoring / sleep talk recording?

Kristen Parisi

unread,
Feb 4, 2017, 9:19:38 AM2/4/17
to Sleep as Android
I have the same model phone and had the same noise in my first recording. As a an audio engineer, I think it has to do with the position of the phone after starting the app and the percentage of noise you set as the default. I had mine set on my night stand using sonar with the entire back on the tabletop. I believe the sonar noise bounces off the tabletop and re-enters the microphone, which creates the echo we heard. I tested the sonar noise and could audibly hear it playing, so I'm going to try again tonight by changing the noise value from 15% to 50% and position the speaker end of the phone to lay off of the tabletop. Will report back if I find the magic formula.

icwiz

unread,
Feb 4, 2017, 9:32:03 AM2/4/17
to Sleep as Android

On Monday, January 23, 2017 at 6:57:48 AM UTC-6, Jiri Richter wrote:

Jiri replied

Jan 23, 13:57
Hello Sleep as Android,
we have this reported, but it is device specific and we cannot reproduce this on any phone around, also we don't have a theory how this happens and how we could possible prevent it, so I can only recommend not using Sonar or sleep noise recording for the time being before we get hands on an affected phone and find a solution..

What frequency of the sound pulse that is sent out by the sonar function? Does the waveform recorded match the one the sonar function uses?  This might be an issue samsung has in its microphone drivers. Once the frequency goes past a certain point, its converted down in the OS to something humanly audible. 

--Amir

icwiz

unread,
Feb 4, 2017, 9:33:56 AM2/4/17
to Sleep as Android


On Saturday, February 4, 2017 at 8:19:38 AM UTC-6, Kristen Parisi wrote:
I have the same model phone and had the same noise in my first recording. As a an audio engineer, I think it has to do with the position of the phone after starting the app and the percentage of noise you set as the default. I had mine set on my night stand using sonar with the entire back on the tabletop. I believe the sonar noise bounces off the tabletop and re-enters the microphone, which creates the echo we heard. I tested the sonar noise and could audibly hear it playing, so I'm going to try again tonight by changing the noise value from 15% to 50% and position the speaker end of the phone to lay off of the tabletop. Will report back if I find the magic formula.


Interesting. I had it on my nightstand too, but i have this thick carpet-like material on it. I beleive this should have reduced the sound reflection. Also, this doesn't explain why the sound is being recored at a frequency that is audible.  

Kristen Parisi

unread,
Feb 4, 2017, 9:43:05 AM2/4/17
to Sleep as Android
Right. It should have reduced the reflection. However, the sonar sound is audible to the naked ear. If you open the app, go to settings, then select test (I think I'm missing a step in there, but you should be able to find it), you'll hear the audible sonar sound. I hadn't realized it when I started the app for the first time, but you can hear the sonar sound. If you have the noise sensitivity in the app set high enough, it only makes sense that the app will pick it up.

Kristen Parisi

unread,
Feb 4, 2017, 9:56:38 AM2/4/17
to Sleep as Android
I've just tried several combinations of settings using noise percentages and positions of the phone on different surfaces. While I can get the phone to not record when there is silence, as soon as it detects a noise and begins recording, it picks up only the sonar noise. Then it continuously records just the sonar noise. It seems as though sonar does not work as intended with Samsung microphones and/or speakers. Either the sonar noise doesn't play correctly on the speakers, or the mic is too sensitive. I guess I'll have to try accelerometer tonight instead.

icwiz

unread,
Feb 4, 2017, 3:21:56 PM2/4/17
to Sleep as Android

I believe i have found what is happening. The audio pulse being recorded is an artifact being created by the speaker when its creating the high frequency sound.  I was able to record the 23kHz sound on my laptop. At the same time, there is a audible sound being created by the speaker. It is the exact sound being recorded by the mic.  

I used Audacity to confirm the frequency being generated. 


Audio is attached.





On Monday, January 23, 2017 at 6:57:48 AM UTC-6, Jiri Richter wrote:
audibleplusultra.wav

Jiří Richter

unread,
Feb 7, 2017, 5:40:29 AM2/7/17
to Sleep as Android
Hello guys, many thanks for this discussion!
We could pretty much use some help from an audio engineer on this. We have found similar things as you have already - there is some crosstalk between mic and speaker, this is inevitable, but also some devices including Samsung do downconvert a portion of the signal recorded to a hearable frequency, which results in the artifacts being recorded.
Some devices do this also on speakers.

There are two possibilities. 
1) the mics/speakers are not fit for ultrasound and they distort the sound physically (but we use frequencies about 18-22 kHz, so this should be well supported)
2) the firmware really does some badly designed filtering which produces the artifacts either on way in or out

Do you have any further ideas?

icwiz

unread,
Feb 7, 2017, 11:06:35 PM2/7/17
to Sleep as Android
I was able to use a frequency generator app to create a 22khz tone. I was able to detect it using audacity. There were no other audio artifacts. I also used the same program to create a sweep from 15 to 22khz. It reproduced it without audible artifacts.

LeftOfToday

unread,
Feb 9, 2017, 9:59:02 PM2/9/17
to Sleep as Android
I experience this problem as well on my LG G2.

icwiz

unread,
Feb 10, 2017, 3:32:41 PM2/10/17
to Sleep as Android
Would it be possible to see any code? Is this open source? The answer would have to be somewhere in the audio function. From what I have been able to gather by down cycling the audio, is that the audible artifact is in upper part of the frequency sweep. The sonar uses a cycling sound like a "wowowowowow". When that sound gets to the top frequencies, that part getting down cycled to audible frequencies.  This may suggest that the frequency values are getting wrapped back somehow. 


--Amir


On Tuesday, February 7, 2017 at 4:40:29 AM UTC-6, Jiří Richter wrote:

Christen Lewis

unread,
Feb 18, 2017, 1:59:53 AM2/18/17
to Sleep as Android
I'm having the same issue, and not only that, it's creating a popping / cracking feedback sound that is loud enough to wake me up. I can't use the app anymore until this is resolved. I also have the phone lying flat on a nightstand. It's a Nexus 6P.

Charles Roberts

unread,
Feb 23, 2017, 9:44:31 PM2/23/17
to Sleep as Android
I get the chirping pattern in all sleep recordings on S7, Tab3 and an S5. I do not have artifacting. during monitoring. It is loud enough in  the recording to drown out the snoring that triggered the recording. but apparently it comes from the device not the mike, since it doesnt actually trigger recordings, it only gets recorded on recordings triggered by external sounds like snoring,

Charles Roberts

unread,
Feb 28, 2017, 8:51:05 AM2/28/17
to Sleep as Android
New Beta from the 27th. problem still there

Karla Rutukaru

unread,
Mar 1, 2017, 4:38:09 AM3/1/17
to Sleep as Android
Same issue here with Samsung Galaxy A3 2016. .. 

K.

Dne úterý 28. února 2017 14:51:05 UTC+1 Charles Roberts napsal(a):

Aidan Molloy

unread,
Mar 13, 2017, 5:38:25 PM3/13/17
to Sleep as Android
Same issue on S7. Only related to Sonar use and makes the audio recordings useless.

SeattleDan

unread,
Mar 27, 2017, 2:45:05 AM3/27/17
to Sleep as Android
Another Galaxy S7 with the issue. Disabling sleep recordings...
Message has been deleted

Joe Anderson

unread,
May 31, 2017, 11:09:23 AM5/31/17
to Sleep as Android
Here's some more data.

I have a Moto X (2nd Generation). I'm using the default sonar settings, which is almost maximum signal strength, frequency range F18-20.

When I run the sonar test, I can hear only a very faintly audible pulse when I get my ear right next to the phone. I mostly feel the pulse in my ear at that point, rather than actually hearing sound. No big deal.

After a sleep, the noise recording regularly (every 20 mins) records about 10 mins of a pulse that is clearly audible when playing back the recording, though nothing like that is audible for my ear while the recording is being made, as mentioned above. I assume that if it weren't holding itself back, it would record the whole night's audio.

I have attached the following files, both .m4a for the audio and .png for the frequency spectrum found by Audacity:
  • Sleep as Android internal
    This is a sample of what came from an overnight noise recording, picking up a nonexistent audible pulse.
  • Sleep as Android external
    This is a recording with my laptop microphone while running the sonar test on the phone.
  • Sleep as Android external bg
    This is a control recording with my laptop microphone, without running the sonar test on the phone.
The laptop recordings confirm that the sound produced is actually 18 kHz and above. The phone records this as a pulse in the frequency range 14 kHz and below.

I tried various ways of recording the sonar test audio through the phone by other means, and none of them panned out:
  • When I used a separate audio recording app, the sonar test would never actually start up (I assume because it was waiting for control of the microphone)
  • When I tried to record my laptop playing Sleep as Android external.mp4, the recording had no pulse content. I cannot discern if that was due to the speaker or recording capabilities, but I suspect the pulses were not being produced, i.e., speaker limitations were the problem.
If anyone else can manage to output the external recording accurately and has one of the phones with the issue, seeing how other recording apps perceive it would be useful. (If they drop it down to an audible frequency as well, it would support the claim that there is something silly happening either at the hardware level, or at the driver level before the apps get the audio.)
Sleep as Android internal.m4a
Sleep as Android external bg.m4a
Sleep as Android external.m4a
Sleep as Android internal.png
Sleep as Android external bg.png
Sleep as Android external.png

Keith Hallman

unread,
Jun 19, 2017, 2:45:56 PM6/19/17
to Sleep as Android
I recently upgraded to a S7 Edge and I am also getting the beeping/chirping sound described above. I never had this problem on my Moto X (2nd gen).

I am running the most up-to-date version of Android Sleep (June 16th RC). I have only had the phone a few days, so I can't comment on earlier releases.

I am an Electrical Engineering student and I do HiFi audio reviews for companies like Orange Amplification and Burson Audio. As a result of that, I have multiple ways to produce sounds and professional measurement mic setup Nady CM100 + Rolls Mini-Mic Preamp going into a Creative ZXr line in.

So if there are specific things you'd like me to test let me know.

Petr Nalevka

unread,
Jun 20, 2017, 4:27:31 AM6/20/17
to Sleep as Android Googlegroup, sleep-as...@googlegroups.com

Petr replied

Jun 20, 10:27
Hello,

many thanks for reporting the issue. On some devices the sonar sound which we produce can also get recorded through some feedback loop or may produce audible artifacts in lullabies or normal use.

We should have a workaround for this with our Sonar version 2 we are currently working on. The new method should not produce this kind of artifacts in recordings or playback. Would you be willing to test this out?

Please make sure to install the latest BETA version. If you are no already in the BETA group please opt-in here:
https://play.google.com/apps/testing/com.urbandroid.sleep
or install the APK from:
http://sleep.urbandroid.org/wp-content/uploads/release/sleep-20170505-beta-release.apk

Please go to Settings - Sleep tracking - Sensor: Sonar - Test sensor. After your signal strength gets detected, please use the switch right to the volume bar and choose F20 instead of F18-20, wait until signal strength gets detected again and see if sonar reacts ok to your movement. If there are any issues, please or you feel sonar is not that sensitive, please try F19 and than F18. Please let me know if this new setup does not produce any artifacts.


Thank you very much.

Best regards,

Petr Nalevka
Urbandroid Team

Did we help you? Please help us by rating our app.

Sleep as Android Googlegroup sent a message

Jun 19, 20:46
--
You received this message because you are subscribed to the Google Groups "Sleep as Android" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sleep-as-an-dr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

{#HS:383576072-38176#}

Алексей Щербаков

unread,
Jul 13, 2017, 12:53:26 PM7/13/17
to Sleep as Android

Hello. I begin to try to follow the dream with the help of the sonnar. There are questions: what volume level is optimal for quality tracking? (When testing, digits are written, it may be better to make the values ​​in decibels?). My device (Meso MKS4PRO) is supported. When setting "20" and the maximum level is sometimes maintained .. Level 1-10 .. with the setting "19" and the maximum quality level is ~ 100-150. When setting "18" - 300-500 .. But! The quietest mode is "19". At 18 - too obvious itching sounds. At 19 - the phone does not hiss loudly. Not louder than the noise from the busy street with double-glazed windows on the window. At 20 - also a weak itching. I think that the frequency of 18-19-20 kHz should not be audible at all for hearing. It turns out that backward harmonics are generated in the sound path. I watched the sound spectrum with a running sonar and saw a floating splash in the 45 Hz range, which is hardly reproduced by the device, but can introduce extraneous sounds. The hiss is due to the fact that just the audio path is turned on to sufficient volume? Is it possible to suppress-subtract the resulting additional distorted frequencies. Why are 18 and 20 itchy, and 19 not?
Also at sonar the battery is spent much more than with the accelerometer. About 40% per night.

Jiri Richter

unread,
Jul 20, 2017, 10:13:57 AM7/20/17
to Sleep as Android Googlegroup

Jiri replied

Jul 20, 16:13
Hello,

we are generally unable to test for all the phones. On a lot of phones there is some proprietary signal processing in the way that scrambles the sonar signal and shifts the spectrum and we are unfortunately unable to prevent or even detect that.
If sonar works for you at the 19 kHz setting, then it's great!
If it does not, I can only recommend to use accelerometric sensor.


Thank you very much.

Best regards,

Jiri Richter

Urbandroid Team

Did we help you? Please help us by rating our app.

Follow us: 


Sleep as Android Googlegroup sent a message

Jul 13, 18:53
Hello. I begin to try to follow the dream with the help of the sonnar. There are questions: what volume level is optimal for quality tracking? (When testing, digits are written, it may be better to make the values ​​in decibels?). My device (Meso MKS4PRO) is supported. When setting "20" and the maximum level is sometimes maintained .. Level 1-10 .. with the setting "19" and the maximum quality level is ~ 100-150. When setting "18" - 300-500 .. But! The quietest mode is "19". At 18 - too obvious itching sounds. At 19 - the phone does not hiss loudly. Not louder than the noise from the busy street with double-glazed windows on the window. At 20 - also a weak itching. I think that the frequency of 18-19-20 kHz should not be audible at all for hearing. It turns out that backward harmonics are generated in the sound path. I watched the sound spectrum with a running sonar and saw a floating splash in the 45 Hz range, which is hardly reproduced by the device, but can introduce extraneous sounds. The hiss is due to the fact that just the audio path is turned on to sufficient volume? Is it possible to suppress-subtract the resulting additional distorted frequencies. Why are 18 and 20 itchy, and 19 not?
Also at sonar the battery is spent much more than with the accelerometer. About 40% per night.

--
You received this message because you are subscribed to the Google Groups "Sleep as Android" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sleep-as-an-dr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

{#HS:396886587-39111#}

Keith Hallman

unread,
Jul 24, 2017, 3:53:36 PM7/24/17
to sleep-as...@googlegroups.com
I stopped using sonar and now have a Xiaomi MiBand2 that tracks everything with heart rate tracking instead of sonar, although you can use both I believe.

Thanks for your help on this manner.

To unsubscribe from this group and stop receiving emails from it, send an email to sleep-as-an-droid+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

{#HS:396886587-39111#}

--
You received this message because you are subscribed to a topic in the Google Groups "Sleep as Android" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sleep-as-an-droid/HVYBV8B01Gw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sleep-as-an-droid+unsubscribe@googlegroups.com.

Achim Pohl

unread,
Sep 18, 2017, 6:13:23 PM9/18/17
to Sleep as Android
Hello Urbandroid team!
Thank you for the excellent work on the app. I can't live without it anymore.

Adressing the chirping sound during recording (yeah, my S8 does it, too):
What about an (adjustable) low-pass filter for noise recordings? Don't ask me how to implemet this for an Android app, I'm just a medical technician :) I will have to put the recording through spectrum analysis, but from listening to it I'd say it is well above 1 kHz. Vocal range is around 1 kHz, mostly below. Snoring is even lower. So if we could cut off anything above 1 kHz, the chirping should be mostly gone, while still recording sleeptalking and snoring. With an adjustable low-pass filter, any user could fine-tune the cutoff in a way to minimize (at least) or to completely eliminate the chirp for the recording. A slight equalization boosting frequencies around and below 500 Hz also should improve snoring detection.

Some thoughts I'll investigate: the recorded chirping sounds like a frequenzy wobble or ramp. I only recorded in the "18-20" setting by now, since it gives me the most precicse motion tracking and I guess it represents a wider frequency range used for probing sounds. I'll verify if the narrower bands of 18 or 19 produce a narrower artifact which could be filtered or cancelled out by a bandpass. Another idea would be to mute the microphone during emission of the probing sound, but a quick calculation tells me that this would be impractical, since the echo of the sound at such a short distance comes back at less than a millisecond. If you mute the microphone for the duration of the pulse, you still would record harmonics or reflexes from inside the phone housing. Weak idea. Do I count three bursts a second for your sonar? Timing would be a mess...

I'll sound back if I have results of testing and frequency analysis.

Regards,

Achim 
Reply all
Reply to author
Forward
0 new messages