# freq2delta

Convert frequency to delta value for PicoScope Arbitrary Waveform Generators.

## Contents

- Syntax
- Description
- Example
- Input Arguments
- Output Arguments

## Syntax

    P = freq2delta(F, W, B, D)

## Description

freq2delta(F, W, B, D) converts a frequency value F in hertz into a uint32 delta phase value using the waveform size W, maximum buffer size of the PicoScope device B and DAC Frequency of the Arbitrary Waveform Generator (AWG), D.

## Example

    F = 1000;  % Hz
    W = 16384; % samples
    B = 32768; % samples
    D = 20e6;  % 20 MS/s

    P = freq2delta(F, W, B, D)

    P =

      uint32

       107374

## Input Arguments

- F - the frequency in hertz (scalar or vector of 2 elements)
- W - waveform size in samples (positive integer scalar)
- B - maximum buffer size of the AWG in samples (positive integer scalar)
- D - the DAC Frequency of the AWG in megasamples per second (real finite positive scalar value)

## Output Arguments

- P - the delta phase value corresponding to the frequency specified (uint32 datatype scalar value)

Copyright: © 2015-2019 Pico Technology Ltd. All rights reserved.