EchoMap 2026-07-25 6d3977c
An experimental cross-platform digital signal processing application for sound-source localisation.
Loading...
Searching...
No Matches
FrequencySpectrumFactory.hpp
Go to the documentation of this file.
1
9
10#ifndef ECHOMAP_FREQUENCYSPECTRUMFACTORY_HPP
11#define ECHOMAP_FREQUENCYSPECTRUMFACTORY_HPP
12
13#include <memory>
14#include <span>
15
17#include "../Signal.hpp"
18
19namespace echomap
20{
21
22class FFTWBuffers;
23
28{
29public:
43 const Signal& signal,
44 WindowFunctions::AllFunctions window_function,
45 std::size_t transform_size
46 );
47
48private:
60 static float prepare_input(
61 const FFTWBuffers& buffers,
62 WindowFunctions::AllFunctions window_function,
64 );
65
72 [[nodiscard]] static Signal::Sample::AmplitudeT amplitude_to_dbfs(Signal::Sample::AmplitudeT amplitude) noexcept;
73};
74
75} // namespace echomap
76
77#endif // ECHOMAP_FREQUENCYSPECTRUMFACTORY_HPP
FrequencySpectrum specification.
Audio signal class specification.
Simple RAII wrapper for commonly used C types from FFTW(f).
Provides a static helper to perform discrete Fourier transforms on Signal objects to produce frequenc...
static Signal::Sample::AmplitudeT amplitude_to_dbfs(Signal::Sample::AmplitudeT amplitude) noexcept
Convert an amplitude to a dBfs (decibels relative to full-scale) quantity.
static float prepare_input(const FFTWBuffers &buffers, WindowFunctions::AllFunctions window_function, std::span< const Signal::Sample::AmplitudeT > input)
Copies and prepare the input amplitude time-series for FFT with the given window function preference.
static std::unique_ptr< FrequencySpectrum > create_frequency_spectrum(const Signal &signal, WindowFunctions::AllFunctions window_function, std::size_t transform_size)
Construct a FrequencySpectrum of the given uniformly sampled Signal.
A single channel of discretely sampled audio data.
Definition Signal.hpp:40
The main EchoMap outermost namespace for all non-exported symbols.
float AmplitudeT
Type for sample amplitudes.
Definition Signal.hpp:48