summaryrefslogtreecommitdiff
path: root/Gen/GenTrig.swift
blob: 84bf9cfa03d1a05231507d8fc20d9bc61bf35e31 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
//  GenTrig.swift
//  PrySDR
//
//  Created by Jacky Jack on 26/10/2024.
//

/// Generate sin function as float array
/// - Parameters:
///   - sample_rate: sample rate, how many samples per second
///   - freq: sin frequency
///   - ampl: amplitude
///   - phase: phase of sin
///   - sample_num: number of samples to generate
/// - Returns: Array of floats within range [-ampl ... apml]
///
func genSin(_ sample_rate: Int,_ freq: Float,_ ampl: Float,_ phase: Float,_ sample_num: Float) -> Array<Float> {
    return [0.0]
}

/// Generate Cos function as float array
/// - Parameters:
///   - sample_rate: sample rate, how many samples per second
///   - freq: sin frequency
///   - ampl: amplitude
///   - phase: phase of sin
///   - sample_num: number of samples to generate
/// - Returns: Array of floats within range [-ampl ... apml]
///
func genCos(_ sample_rate: Int,_ freq: Float,_ ampl: Float,_ phase: Float,_ sample_num: Float) -> Array<Float> {
    return [0.0]
}