Author |
Message |
Grumble
Joined: Nov 23, 2015 Posts: 1294 Location: Netherlands
Audio files: 30
|
Posted: Mon Sep 16, 2019 10:47 pm Post subject:
Everything you always wanted to know about wavetables Subject description: but were afraid to ask... |
|
|
http://synthtech.com/waveedit/
A very nice website where you can download (free) the program WAVEedit.exe to get acquainted with wavetables, how they sound and look like.
You can even save them as a .wav files
_________________ my synth |
|
Back to top
|
|
|
PHOBoS
Joined: Jan 14, 2010 Posts: 5591 Location: Moon Base
Audio files: 705
|
|
Back to top
|
|
|
ixtern
Joined: Jun 25, 2018 Posts: 145 Location: Poland
|
|
Back to top
|
|
|
ixtern
Joined: Jun 25, 2018 Posts: 145 Location: Poland
|
|
Back to top
|
|
|
Grumble
Joined: Nov 23, 2015 Posts: 1294 Location: Netherlands
Audio files: 30
|
Posted: Thu Sep 19, 2019 1:47 am Post subject:
|
|
|
It's offtopic, but this is how I program the AD9833:
Code: |
/* name AD9833 calculation macros */
#define AD_F_MCLK 16000000 // Clock speed of the ad9833 reference clock
#define AD_2POW28 268435456 // Used in calculating output freq
/* Macro that calculates the value for a ad9833 frequency register from a frequency */
#define AD_FREQ_CALC(calc_freq) (float)(((double)AD_2POW28/(double)AD_F_MCLK*calc_freq)*4)
frequency_word = AD_FREQ_CALC(frequency_AD9833);
high = uint16_t (AD_FREQ0 | (0x3FFF&(uint16_t)(frequency_word>>16)));//HIGH word for DDS
low = uint16_t (AD_FREQ0 | (0x3FFF&(uint16_t)(frequency_word>>2 )));//LOW word for DDS
/*
wave shapes are:
AD_SINE, AD_SQUARE or AD_TRI
remember: AD_SQUARE puts out a square of 0 - 5volt, while AD_TRI and
AD_SINE puts out 0 - 0.65 volt
*/
ad9833_send(AD_SINE);// set waveform shape
ad9833_send(low);//low word
ad9833_send(high);//high word
|
_________________ my synth |
|
Back to top
|
|
|
ixtern
Joined: Jun 25, 2018 Posts: 145 Location: Poland
|
Posted: Thu Sep 19, 2019 2:16 am Post subject:
|
|
|
And this is how I am doing it:
Code: |
// -------------------------------------------------------------------------
// Set frequency of the first AD9833 unit using global variables
// -------------------------------------------------------------------------
void SetAD9833_1(void)
{
// With 8000000 clock sometimes problems happens (corrupted data)
SPI.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE2));
//WriteRegisterAD9833_1(0x2000); // no reset bit NOT WORKING
WriteRegisterAD9833_1(0x2100); // reset bit set
WriteRegisterAD9833_1(AD9833_1_256_LSB);
WriteRegisterAD9833_1(AD9833_1_256_MSB);
WriteRegisterAD9833_1(0x2028); // set square wave, reset bit cleared
SPI.endTransaction();
} |
Thread starts to be half-Arduino now |
|
Back to top
|
|
|
Grumble
Joined: Nov 23, 2015 Posts: 1294 Location: Netherlands
Audio files: 30
|
Posted: Thu Sep 19, 2019 2:43 am Post subject:
|
|
|
Difference is that you get your register data from a lookup table and I calculate the register data from a given frequency. _________________ my synth |
|
Back to top
|
|
|
ixtern
Joined: Jun 25, 2018 Posts: 145 Location: Poland
|
Posted: Thu Sep 19, 2019 3:16 am Post subject:
|
|
|
Grumble wrote: | Difference is that you get your register data from a lookup table and I calculate the register data from a given frequency. |
Yes, I wanted to do it faster because I've planned to control 8 VCOs from one Arduino with many additional functionalities. |
|
Back to top
|
|
|
|