Linux IIO development
 help / color / mirror / Atom feed
From: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
To: "Uwe Kleine-König" <u.kleine-koenig@baylibre.com>
Cc: "Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Nuno Sá" <noname.nuno@gmail.com>,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH v2 1/3] iio: adc: ad7124: Fix 3dB filter frequency reading
Date: Wed, 26 Mar 2025 15:20:24 -0300	[thread overview]
Message-ID: <Z-RFaLU5jtOScJiu@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <20250317115247.3735016-6-u.kleine-koenig@baylibre.com>

Hello,

On 03/17, Uwe Kleine-König wrote:
> The sinc4 filter has a factor 0.23 between Output Data Rate and f_{3dB}
> and for sinc3 the factor is 0.272 according to the data sheets for
> ad7124-4 (Rev. E.) and ad7124-8 (Rev. F).

Potentially dumb question but, how do we get to these factors between ODR and
3dB frequency?
Looking at Table 8, Table 18, Table 28, and 
dividing values from Output Data Rate (SPS) column by respective
values from f3dB (Hz) column gives me 4.3478.
If the zero latency mode SPS values are used as numerator, the result is 1.0869
for most pairs of SPS and f3dB.

> 
> Fixes: cef2760954cf ("iio: adc: ad7124: add 3db filter")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
> ---
>  drivers/iio/adc/ad7124.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/adc/ad7124.c b/drivers/iio/adc/ad7124.c
> index 3ea81a98e455..7d5d84a07cae 100644
> --- a/drivers/iio/adc/ad7124.c
> +++ b/drivers/iio/adc/ad7124.c
> @@ -301,9 +301,9 @@ static int ad7124_get_3db_filter_freq(struct ad7124_state *st,
>  
>  	switch (st->channels[channel].cfg.filter_type) {
>  	case AD7124_SINC3_FILTER:
> -		return DIV_ROUND_CLOSEST(fadc * 230, 1000);
> +		return DIV_ROUND_CLOSEST(fadc * 272, 1000);
>  	case AD7124_SINC4_FILTER:
> -		return DIV_ROUND_CLOSEST(fadc * 262, 1000);
> +		return DIV_ROUND_CLOSEST(fadc * 230, 1000);
>  	default:
>  		return -EINVAL;
>  	}
> -- 
> 2.47.1
> 
> 

  reply	other threads:[~2025-03-26 18:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-17 11:52 [PATCH v2 0/3] iio: adc: ad7124: Fix 3dB filter frequency reading Uwe Kleine-König
2025-03-17 11:52 ` [PATCH v2 1/3] " Uwe Kleine-König
2025-03-26 18:20   ` Marcelo Schmitt [this message]
2025-03-31 13:38     ` Uwe Kleine-König
2025-03-31 14:40       ` Marcelo Schmitt
2025-03-17 11:52 ` [PATCH v2 2/3] iio: adc: ad7124: Remove ability to write filter_low_pass_3db_frequency Uwe Kleine-König
2025-03-26 18:35   ` Marcelo Schmitt
2025-03-31  9:53     ` Jonathan Cameron
2025-03-17 11:52 ` [PATCH v2 3/3] iio: adc: ad7124: Make register naming consistent Uwe Kleine-König
2025-03-17 19:00 ` [PATCH v2 0/3] iio: adc: ad7124: Fix 3dB filter frequency reading Jonathan Cameron
2025-03-24  9:44   ` Uwe Kleine-König
2025-03-31 10:02     ` Jonathan Cameron
2025-04-06 10:54       ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z-RFaLU5jtOScJiu@debian-BULLSEYE-live-builder-AMD64 \
    --to=marcelo.schmitt1@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=noname.nuno@gmail.com \
    --cc=u.kleine-koenig@baylibre.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox