This is a signal calculation/drawing software based on expression, the main function is to sample the signal given by an expression or a function, then execute the calculation of the sample sequences, and draw the results into the diagram. Using the shared library to extend functions is supported.
This software supports multiple platforms deployment, this feature mainly benefits from QT cross-platform API and CMake multiple platforms build ability, you could build applications of different platforms on one host. Currently, the Ubuntu 22.04(based on Win11 WSL2)、Win7/Win10/Win11、Android x86/Android armeabi-v7a(based on Win11 WSA and Realme X2 Pro) is tested passed
This software supports translations, powered by the QT linguist tool. Currently have Chinese simplified translate data(using English in software is default, then use translate data to translate, this is the solution recommended by the QT linguist module), if you want to add more language support, you could use the QT linguist tool to generate .ts file of this project, such as this file ui/zh_CN.ts, then translate the item in the .ts file manually, finally release this .ts file to .qm file.
The Software will get system locale information at launch time, therefore it can automatically match your system language setting. If your setting is an unsupported language, it will display in English.
If you have questions about using this software、reading the code or building this project, please leave an issue, I will handle it if I see it.
Right-click in signal list widget(long press for Android), select Add Signal
in the popup, input a signal expression, set the Sample Rate and the Sample Points, click calculate button then you can see the wave.
Signal can nested use, to make it easy to use multiple signals to calculate, maximum nest level is 32.
Except sin and cos, some other functions could be used, such as the software random number function(rand
) and the hardware random number function(hrand
).
Fourier transforms, calling length
function is because the fft
function outputs complex number, the length
function is to calculate the length of a complex number, therefore it could calculate the amplitude spectrum.
The filters
library has serval filter functions, lpf
and hpf
are IIR filters, they are low pass filters and high pass filters. Receive a sample sequence and a stop frequency as arguments, 'fir` is a FIR filter, receive a sample sequence、a filter order and a filter coefficient (can export by Matlab) as arguments.
There are 1 order IIR low pass filter、3 order IIR low pass filter and 32 order FIR low pass filter demo, For more information about the filter, please check out 10. Filter guide
You can see, that the higher order of the filter has a better effect by analyzing the spectrum diagram of the signal after the filter.
In this software, all the signal is defined as an expression, such as sin(t)
is the sin signal, and sin(100*t) + sin(200*t)
is adding two different signals with different frequencies together.
A signal can reference another signal, such as sig0 = sin(100*t) sig1 = sin(200*t) sig2 = sig0+sig1
The signal reference itself or multiple signal cross-reference will trigger the maximum nest limit
After using fft
function to calculate the Fourier transformation of a signal, if you only use length
function to calculate the amplitude spectrum, the X axis of the diagram is the index of the data point, such as the following diagram.
You can see that the position of the crosshairs is X coordinate 10, this is the index of that data point in the sample sequence, if you want to know the frequency of this point, you need to calculate it by yourself, we know X=10, the sample rate is 5KHz, sample point is 256, so the frequency of this point is 5000/256*10=195.3Hz
, it represents the 200Hz frequency in the original signal. Although doing that calculation is simple, it is also annoying, and all of the arguments we use to calculate are also in the software, so, you could check the spectrum mode checkbox in the lower right corner to make the software calculate instead of us.
After checking the spectrum mode checkbox, the X axis will be the actual frequency, such as in the following diagram. It is the signal we used in the diagram above, but the spectrum mode checkbox is checked, you can see that the position of the crosshairs is X coordinate 195.313, which is the same as our calculation result.
Something you need to know is, that the spectrum mode actually displays the first half of calculated data, it means if the sample points are 1024, the diagram will display the first 512 data points, this is because the spectrum is symmetrical, so only need the first half data is enough to analyze.
Another thing is, that the fft
function only outputs half of the spectrum, this is also using the symmetrical spectrum. Such as we assume the sample point is 1024, the 1024 real number input to the fft
function will get 512 complex numbers (still are 1024 float variables, but half of them is the real part, other half is the imaginary part), and after calling the length`` function, will get 512 real number, therefore, if you don
t use the spectrum mode, you will find that all the last half of the diagram is zero, that is because of the diagram displays 1024 data points but we actually have only 512 data. If you use the spectrum mode, based on what I said above, the diagram will display 512 data points, this is a way to make full use of the display space to display valuable data.
This software has a built-in compiler, it supports common math expressions、double-slash single-line comments and if condition expressions.
Math expressions are the simplest math equations, such as (sin(t)+cos(t+3))*6
Double-slash single-line comments are the same as in C programming language, such as sin(t)//sin of t
, chars after the double-slash is ignored by the compiler.
if condition expressions have the same logic as C programming language, but do not use ?
:symbols and use **if** and **else** keywords, the grammar order is also different, actually, this is the same design as Python, the grammar rule is
math expression + if keyword + compare expression [+ else keyword + math expression]`, the content surrounded by the square bracket is optional, such as:
index > 15 ? 5 : 3
in Cindex > 15 ? 5 : 0
in CCombine if condition expression and index variable can generate step signal and impulse signal very easily, such as:
The compiler supports these variables:
t = n/fs
The compiler supports a constant pi, representing the value of pi.
The compiler is case insensitive, pi equals PI Pi pI, and t is also equal to T.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。