diff --git a/firmware/baseband/channel_stats_collector.hpp b/firmware/baseband/channel_stats_collector.hpp
index 44d707536..8e69448ea 100644
--- a/firmware/baseband/channel_stats_collector.hpp
+++ b/firmware/baseband/channel_stats_collector.hpp
@@ -36,15 +36,7 @@ class ChannelStatsCollector {
 public:
 	template<typename Callback>
 	void feed(const buffer_c16_t& src, Callback callback) {
-		auto src_p = simd32_ptr(src.p);
-		const auto end_p = simd32_ptr(&src.p[src.count]);
-		while(src_p < end_p) {
-			const uint32_t sample = *(src_p++);
-			const uint32_t mag_sq = __SMUAD(sample, sample);
-			if( mag_sq > max_squared ) {
-				max_squared = mag_sq;
-			}
-		}
+		max_squared = compute_max_squared(src, max_squared);
 		count += src.count;
 
 		const size_t samples_per_update = src.sampling_rate * update_interval;
@@ -63,6 +55,24 @@ private:
 	static constexpr float update_interval { 0.1f };
 	uint32_t max_squared { 0 };
 	size_t count { 0 };
+
+	static uint32_t compute_max_squared(
+		const buffer_c16_t& src,
+		uint32_t max_squared
+	) {
+		auto p = simd32_ptr(src.p);
+		const auto end_p = simd32_ptr(&src.p[src.count]);
+
+		while(p < end_p) {
+			const uint32_t sample = *(p++);
+			const uint32_t mag_sq = __SMUAD(sample, sample);
+			if( mag_sq > max_squared ) {
+				max_squared = mag_sq;
+			}
+		}
+
+		return max_squared;
+	}
 };
 
 #endif/*__CHANNEL_STATS_COLLECTOR_H__*/