Feedback on recorder system

Designing hardware that uses VLSI Solution's devices as slave codecs such as an external MP3 decoder chip for a host microcontroller.
Post Reply
Surfer
User
Posts: 3
Joined: Sun 2017-11-19 20:08

Feedback on recorder system

Post by Surfer » Sun 2017-11-19 20:13

Hi,

I have a conceptual question and would love some feedback on which direction I should take.

I am looking to build a device that continuously records audio and saves it as an ogg file on SD storage. The system will communicate via BT and have a RTC. The goal is to be as energy efficient as possible and therefore I am thinking of two solutions.

- My first idea is to use a low energy host MCU connected to a VS1053 or VS1063 with an analogue MEMS microphone.

- My second idea is to use a Cortex-M4 MCU and connect a digital MEMS microphone and encode the audio via software (if possible?).

Which of the above setups would be most ideal from a energy conservation standpoint? Any other setups that would work better?

I am new to this and appreciate any feedback!

Thanks!

User avatar
Panu
VLSI Staff
Posts: 2428
Joined: Tue 2010-06-22 13:43

Re: Feedback on recorder system

Post by Panu » Mon 2017-11-20 16:38

Hi, and welcome to the forum!

I think there's several ways to do this. Obviously I'll first try to suggest one of our products; the VS1010 (see VS1010 forum) which has an RTC and two MEMS demodulators on hardware and quite modest power consumption. It also has I2S, 2 UARTs and 2 SPI ports which you can use to communicate with your BT module. Also it has SD card controller and high speed USB/USB host which could be interesting from an expansion point of view. It also contains an operating system on the ROM, so you can for example open files from the SD card with a simple fopen() call.

If you take the other route: using a generic microcontroller to read the MEMS data, I think it is possible but there's quite a lot of signal processing software to write. From the interface point of view, you'll need to generate about 3 MHz bit clock signal and then clock in the individual bits from the mic. I think you should be able to configure a synchronous serial port on your cortex to do this. Then you'll need to write a sigma delta demodulator and decimator software to decimate the bitstream into usable PCM samples. The first stages require quite a lot of CPU cycles and the final stages require quite a lot of understanding in signal processing. Because the first steps in mems microphone demodulation are very CPU intensive, our IC has hardware demodulators that first decimate and low pass filter the micophone signal to 192 kHz. And then we use our DSP to further filter and downsample it to 48 kHz.

If you do the whole conversion in software, it's basically a series of low pass filters and decimations. First you take the 3 Mbits/s serial stream and then repeat lowpass, decimate, lowpass, decimate, lowpass, decimate until you have a PCM stream of a sample rate which is useful to you. Your initial input is at 3 MHz so it will take a lot of CPU to lowpass and decimate, but you can use precalculated const arrays to handle the first couple of steps, e.g. from 3 MHz to 1.5 MHz to 768 kHz to 384 kHz and then continue with more traditional signal processing algorithms. It's very special kind of programming work but I think it should be technically possible with a Cortex.

For reading the data from a MEMS microphone using the VS1010, there is an example code here.

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

Surfer
User
Posts: 3
Joined: Sun 2017-11-19 20:08

Re: Feedback on recorder system

Post by Surfer » Sun 2017-11-26 19:05

Hi Panu,

Thank you for that very comprehensive reply!

I does indeed sound like a complicated process to do this via software. If I understood your reply correctly I will need to do all of the signal processing even if the MEMS microphone is digital? I have found a few tutorials on how to record and create basic wav files with a digital MEMS microphone connected to a generic cortex MCU. But I assume as you say doing all of this in software will probably be more power consuming than using a hardware accelerated DSP?

I will take a look at the VS1010. Looks very promising! You recommend me to use analogue microphones when using the VS1010 or VS1053?

My first idea was to use a nRF52 (with built in BT) connected to a VS1053. But maybe using the VS1010 with an efficient BT module would be better?

Your feedback is much appreciated as my experience in this field is limited.

Thanks!

User avatar
Panu
VLSI Staff
Posts: 2428
Joined: Tue 2010-06-22 13:43

Re: Feedback on recorder system

Post by Panu » Mon 2017-11-27 15:48

Hi!

VS1010 doesn't have analog inputs (except successive approximation ADC) so you'd use a MEMS microphone with VS1010. VS1053 has analog input so you'd use an analog microphone with VS1053.

I'd be interested to find which examples of MEMS to WAV tutorials you have found. The ones I found with Google were really painful to read. Stuff like converting a sign bit to float and then calling filter library functions - that way you'll burn a lot of energy, for sure. (Well, at least the author admitted it was a horribly inefficient idea...) But surely it's a common enough problem that library code of converting PDM to PCM is available, though how open or how high quality it is, I have no idea. After reading stuff from the net, I think that even my previous answer counts as somewhat advanced.. ;)
If I understood your reply correctly I will need to do all of the signal processing even if the MEMS microphone is digital?
Well, yes. Indeed there's actually more signal processing to do than what would be required if the signal was analog. What you're in fact doing, is making the essential parts of an analog-to-digital converter in software, in the digital domain. The good thing about MEMS digital microphones is that the signals in the PCB are digital, so noise coupled to the PCB lines isn't such a disaster as it is in the analog domain, but the complexity of the AD converter must be implemented somewhere; either in dedicated hardware or software.

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

Surfer
User
Posts: 3
Joined: Sun 2017-11-19 20:08

Re: Feedback on recorder system

Post by Surfer » Sat 2017-12-09 15:03

Hi Panu,

Aren't there analog MEMS microphones available? From what I understand they are a lot smaller and convenient to use in smaller devices.

It sounds like you found the same tutorials as I did regarding WAV files. As you say it doesn't sound like an energy efficient process which is one of my requirements. Using one of your dedicated hardware solutions will probably be the better solution. I will try and put together a prototype using either an VS1053 or a VS1010 and see how it goes.

Thanks!

User avatar
Panu
VLSI Staff
Posts: 2428
Joined: Tue 2010-06-22 13:43

Re: Feedback on recorder system

Post by Panu » Wed 2017-12-13 19:16

Aren't there analog MEMS microphones available?
Yes, but in the case of the VS1010, we're speaking specifically of a digital MEMS microphone, since the VS1010 has a digital MEMS microphone demodulator, but not an AD converter.

Well, actually there is the successive approximation AD converter, but that's not exactly Hi-Fi quality...

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

Post Reply