# helia_edge.layers.preprocessing.random_sine_wave

## Random Sine Wave Layer API

This module provides classes to build random sine wave layers.

**Classes**

| Name | Description |
| --- | --- |
| `RandomSineWave` | Random sine wave |

## helia_edge.layers.preprocessing.random_sine_wave.RandomSineWave

`class` · `python`

```python
RandomSineWave(
    sample_rate: float = 1,
    frequency: float | tuple[float, float] = 100,
    amplitude: float | tuple[float, float] = 0.1,
    **kwargs={},
)
```

Adds a sine wave to the input.



Base class: [BaseAugmentation1D](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation1D).

Inherited from [BaseAugmentation](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation): [augment_masks()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.augment_masks), [augment_samples()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.augment_samples), [augment_targets()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.augment_targets), [batch_augment()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.batch_augment), [call()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.call).

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| sample_rate | float | 1 | Sample rate of the input. |
| frequency | float \| tuple[float, float] | 100 | Frequency of the wave in Hz. If tuple, frequency is randomly picked between the values. |
| amplitude | float \| tuple[float, float] | 0.1 | Amplitude of the wave. If tuple, amplitude is randomly picked between the values. |

Source: `helia_edge/layers/preprocessing/random_sine_wave.py:18`

### helia_edge.layers.preprocessing.random_sine_wave.RandomSineWave.data_format

`attribute` · `python`

```python
data_format: str
```

Source: `helia_edge/layers/preprocessing/random_sine_wave.py:23`

### helia_edge.layers.preprocessing.random_sine_wave.RandomSineWave.sample_rate

`attribute` · `python`

```python
sample_rate: float = sample_rate
```

Source: `helia_edge/layers/preprocessing/random_sine_wave.py:42`

### helia_edge.layers.preprocessing.random_sine_wave.RandomSineWave.frequency

`attribute` · `python`

```python
frequency: tuple[float, float] = parse_factor(frequency, min_value=0, max_value=sample_rate / 2, param_name='frequency')
```

Source: `helia_edge/layers/preprocessing/random_sine_wave.py:43`

### helia_edge.layers.preprocessing.random_sine_wave.RandomSineWave.amplitude

`attribute` · `python`

```python
amplitude: tuple[float, float] = parse_factor(amplitude, min_value=0, max_value=None, param_name='amplitude')
```

Source: `helia_edge/layers/preprocessing/random_sine_wave.py:44`

### helia_edge.layers.preprocessing.random_sine_wave.RandomSineWave.get_random_transformations

`method` · `python`

```python
get_random_transformations(input_shape: tuple[int, int, int]) -> dict
```

Generate noise distortion tensor

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| input_shape | tuple[int, ...] | Required | Input shape. |

**Returns**

| Name | Type | Description |
| --- | --- | --- |
| dict | dict | Dictionary containing the noise tensor. |

Source: `helia_edge/layers/preprocessing/random_sine_wave.py:46`

### helia_edge.layers.preprocessing.random_sine_wave.RandomSineWave.augment_sample

`method` · `python`

```python
augment_sample(inputs)
```

Augment single sample with sine wave.

Source: `helia_edge/layers/preprocessing/random_sine_wave.py:66`

### helia_edge.layers.preprocessing.random_sine_wave.RandomSineWave.get_config

`method` · `python`

```python
get_config()
```

Source: `helia_edge/layers/preprocessing/random_sine_wave.py:82`
