<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>PDM Sample Buffer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/22925/pdm-sample-buffer</link><description>Hi, 
 I found your PDM Working Example. However I wonder what to make of the data I get. 
 What is the CONFIG_PDM_BUFFER_SIZE_SAMPLES for? Do I get 16Bit Bit-Schemes from which I must assemble my PCM Data or are there lets say 64 PCM Samples in the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 29 Jul 2019 07:28:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/22925/pdm-sample-buffer" /><item><title>RE: PDM Sample Buffer</title><link>https://devzone.nordicsemi.com/thread/200885?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2019 07:28:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5911c680-3154-42c0-9147-2718c4246fc9</guid><dc:creator>sara</dc:creator><description>&lt;p&gt;Hi , Sigurd, how to get the pdm data ? I am not able to get the data when configured with EasyDMA.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM Sample Buffer</title><link>https://devzone.nordicsemi.com/thread/90174?ContentTypeID=1</link><pubDate>Tue, 20 Jun 2017 14:03:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53cc03cf-0348-4878-8879-23131047dc88</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Yes, that is correct&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM Sample Buffer</title><link>https://devzone.nordicsemi.com/thread/90173?ContentTypeID=1</link><pubDate>Tue, 20 Jun 2017 13:41:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fdf92d14-269a-4ca2-a3d7-d23c21483454</guid><dc:creator>eng</dc:creator><description>&lt;p&gt;Thank you! So do I understand correctly, that, when I want to get the already converted PCM Data, I just need to count the address upwards, dereferencing the *&lt;em&gt;p_buffer&lt;/em&gt; pointer in *static void m_audio_buffer_handler(int16_t &lt;em&gt;p_buffer, uint16_t samples)&lt;/em&gt; while doing so?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PDM Sample Buffer</title><link>https://devzone.nordicsemi.com/thread/90172?ContentTypeID=1</link><pubDate>Tue, 20 Jun 2017 13:08:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ba1fa58-8ee2-443f-af02-70b56dd6bf71</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;CONFIG_PDM_BUFFER_SIZE_SAMPLES&lt;/code&gt; is used to set the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/pdm.html?cp=2_2_0_42_6_11#register.SAMPLE.MAXCNT"&gt;number of samples&lt;/a&gt; to allocate memory for in EasyDMA mode.&lt;/p&gt;
&lt;p&gt;The PDM bitstream is converted into 16-bit PCM samples by the digital filter, and is then filtered and down-sampled to reach the appropriate sample rate.&lt;/p&gt;
&lt;p&gt;You can configure the Decimation Filter Gain by adjusting the GAINL and GAINR registers.&lt;/p&gt;
&lt;p&gt;Snippet from the &lt;code&gt;drv_audio_init()&lt;/code&gt; function in &lt;a href="http://www.nordicsemi.com/eng/Products/Nordic-Thingy-52#Downloads"&gt;Thingy:52 SDK&lt;/a&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ret_code_t drv_audio_init(drv_audio_buffer_handler_t buffer_handler)
{
nrf_drv_pdm_config_t pdm_cfg = NRF_DRV_PDM_DEFAULT_CONFIG(CONFIG_IO_PDM_CLK,
                                                          CONFIG_IO_PDM_DATA,
                                                          m_pdm_buff[0],
                                                          m_pdm_buff[1],
                                                          CONFIG_PDM_BUFFER_SIZE_SAMPLES);
.
.
.
pdm_cfg.gain_l      = CONFIG_PDM_GAIN;
pdm_cfg.gain_r      = CONFIG_PDM_GAIN;

.
. 
.


return nrf_drv_pdm_init(&amp;amp;pdm_cfg, drv_audio_pdm_event_handler);
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>