In the previous post, I introduced my current project, which is comparing multiple additive synthesis implementations, and to find out which one of them is the fastest. I hope to use the results of this project to design a new software synthesizer with unique features. In this post, I will talk more about how I evaluate each of the additive synthesis implementations for speed and accuracy. I will also present other evaluation details.
I want to determine how fast each additive synthesis implementation will be under multiple simulated situations. I will be using the microbenchmarking library nanobench to determine how long it takes for a given implementation to produce signals of varying lengths. In the process, I want to answer these questions:
*How does the implementation scale with the number of sine waves?*Does the implementation have a base load that exists regardless of the number of sines waves? Which implementations are good for generating a low number of sine waves, and which are good for generating many sine waves all at once?*How does the implementation scale with the buffer size?*Within a digital audio workstation (DAW), software synths and other audio plugins are provided with a stream of data samples that to operate on. This stream of data comes in buffers, or*chunks*, of varying sizes. Due to how the CPU works, it is often more efficient for audio plugins to process many data samples all at once. However, with a larger buffer sizes, the DAW must take longer to register all the user input coming in real-time. This is a latency vs. throughput problem, and implementations that respond efficiently to lower latency (i.e. smaller buffer sizes) may be better for real-time performance under high CPU load.*Does the implementation work better with harmonic sounds?*Many sounds in music are harmonic. Since all partials of a harmonic sounds run at multiples of some base frequency, the resulting waveform for the sound is repeating. An additive synthesis implementation can take advantage of this to produce harmonic signals with higher computational efficiency.
All implementations must generate signals with 96db signal-to-noise ratio (SNR). This is a good target because standard quality audio is a 16bit which results in a max of 96db SNR due to quantization noise.
Amplitude deviation, or absolute gain, is the difference between the desired signal amplitude and the generated amplitude. The amplitude deviation must be low, so I will set an arbitrary restriction that the amplitude deviation must be less than 0.1db.The accuracy evaluation is performed using the ordinary least squares calculation. To perform this evaluation, the evaluated additive synthesis implementation will generate a sine wave of a given frequency for a given number of samples. Then, within this generated signal, the evaluation will use a sliding analysis window. The length of the analysis window is approximated 2 times the period of the desired sine wave. Within the analysis window, the evaluation will use ordinary least squares to fit a sine wave with an arbitrary phase to the generated signal. More specifically, the ordinary least squares calculation will determine the coefficients for a cosine (0° phase) component, and a sine (-90° phase) component. The sum of these two components will yield a sine wave with an arbitrary phase that bests fits the generated signal. To summarize, the coefficients are the unknowns that are being solved for; the target sine and cosine components form the explanator matrix, and the generated signal forms the response vector.The SNR calculation treats the difference between the fitted sine wave and the generated signal as noise. The amplitude of the fitted sine wave is determined from the least squares coefficients, and is used to determine amplitude deviation. The analysis window slides along the generated signal in order to find the worst-case evaluation for SNR and amplitude deviation. Additionally, the accuracy evaluation is performed for many different frequencies. The worst-case evaluations for SNR and amplitude deviation among all frequencies are reported.
I will be presenting results that run on my laptop. My laptop has an Intel(R) Core(TM) i5-8265U CPU running at a base clock speed of 1.80GHz. All evaluations will be single-threaded. I will running these evaluations on Windows. I will be using the MSVC compiler with the following compiler arguments: "/O2" for general optimization, "/arch:AVX2" to enable the AVX instructions, and "/fp:fast" for faster arithmetic.
In this post, I talk about how I will perform evaluations of the additive synthesis implementations. I summarize how the speed and accuracy evaluations will be performed. I also give other details about the evaluation. In the next post, I will summarize the simplest additive synthesis implementation, the phase-to-amplitude implementation with
exact sine calculation. I will also go over some design decisions that I use to make this implementation faster while still being accurate.- Introduction and Motivation
**Evaluation Details**
1 Comment
11/15/2022 07:42:56 pm
Trade road pull second. Write mouth still back line public.
Reply
## Leave a Reply. |
This section will not be visible in live published website. Below are your current settings:
Current Number Of Columns are = 1 Expand Posts Area = Gap/Space Between Posts = 10px Blog Post Style = card Use of custom card colors instead of default colors = Blog Post Card Background Color = current color Blog Post Card Shadow Color = current color Blog Post Card Border Color = current color Publish the website and visit your blog page to see the results ## Author
I am Golden Rockefeller, a Ph.D Robotics student at Oregon State University. I will post updates on personal projects that I am working on. My interests include music synthesis, cooking, game design, and intelligent autonomous system. ## Categories
All
## Archives |