RFFT in CMSIS DSP. Part 1. RFFT in STM32 using CMSIS DSP. Part 1. Python warm-up for illustration I always wanted to use MCU for audio processing. And for my purposes, I need Discrete Fourier Transform(DFT), especially its fast version FFT. If you do not know what is this, read Wikipedia first:) FFT has a huge number examples of usage, for my case I want to build wavetable synthesizer. Let’s take some real example. We have an audio signal, which is just a set of amplitudes, which you will take from your ADC. Samples are taken with some sampling frequency Fs. For preliminary illustration, we’ll use Python. import numpy as np import matplotlib . pyplot as plt # Our wave settings N_samples = 32 amplitude = 10 # Here we'll generate our sine wave t = np . arange ( N_samples ) x = amplitude * np . sin ( 2 * np . pi * t / N_samples ) # Plotting fig , ax = plt . subplots ( ) ax . plot ( t , x , 'bo-' ) ax . set_xlabel ( 'N sa...
Thanks Artyom for your two ssd1306 article...This is exactly what I was looking for !
ReplyDeleteIt works fine after having drastically reduced the size of the ug8_font_data.c file.
Chris
Hello, I got your code to work with an STM32F7ZG, so Thanks for you work.
ReplyDeleteOutput of your Hello example seems to take about 88 ms on my board. I would like to speed that up. I noticed that changing SPI speed from below to 1 MHz to above 6 MHz seems to make almost no difference.
Can you suggest a way to speed up the writing?
Hello! I think you can try to re-write u8g_MicroDelay(void) function. In my code sample, there is a large "safety margin": I use 1ms instead 1 microsecond there. So, you can decrease this value putting empty cycle instead of HAL_Delay(1). Just tune this emty "for" loop to your Sysclock value.
DeleteThat did the trick. Thanks!
DeleteI have further questions. My SPI clock is running at 6.75 MHz, and I managed to put a value of zero for both delays and it still runs...so that is curious.
ReplyDeleteBut over all it still takes 8ms now to update the screen, and it seems like it should be faster. Can you think of something else that is taking time? By the way, to get your code to work I loaded everything from your repository into my project.
The last bottleneck on our side is HAL_Delay(1); in U8G_COM_MSG_CHIP_SELECT. Try to remove it. Of course, I doubt that u8glib toggles chip select during refresh, but, anyway, you can try. Also, you can try to make "dirty hack": scale value in u8g_Delay function. I mean, write HAL_Delay(val/10); instead of HAL_Delay(val);
DeleteSo, removed the delay, and now it takes 3-4 ms. Still all seems to run fine without the delays. I plan to switch to a slower board in future, so I will keep them in mind in case I have to put something back. Thanks for your help.
Delete