def test_filter_construction_clamping():
    """
    Test that the filter parameters are clamped correctly during filter construction.
    """
    in_channels = 1
    out_channels = 1
    sequence_length = 256
    sample_rate = 100.0  # Hz
    filter_layer = GeneralizedGaussianFilter(
        in_channels=in_channels,
        out_channels=out_channels,
        sequence_length=sequence_length,
        sample_rate=sample_rate,
        f_mean=(50.0,),  # Above the clamp maximum
        bandwidth=(0.5,),  # Below the clamp minimum
        shape=(1.5,)  # Below the clamp minimum
    )
    filter_layer.construct_filters()
    f_mean_clamped = filter_layer.f_mean.data.item() * (sample_rate / 2)
    bandwidth_clamped = filter_layer.bandwidth.data.item() * (sample_rate / 2)
    shape_clamped = filter_layer.shape.data.item()
    assert f_mean_clamped <= 45.0, "f_mean should be clamped to a maximum of 45.0 Hz"
    assert np.round(bandwidth_clamped) >= 1.0, "bandwidth should be clamped to a minimum of 1.0 Hz"
    assert shape_clamped >= 2.0, "shape should be clamped to a minimum of 2.0"

    Test that the filter parameters are clamped correctly during filter construction.
    
test/unit_tests/models/test_modules.py