According to the function waveform generation method and
system based on expression compilation and adaptive segmented sampling, the combination of an upper computer, an ARM, an FPGA and a DAC is adopted, and the upper computer inputs a segmented function set and parameters; the ARM processor executes expression compilation and completes segmentation coverage degree and continuity
verification; in each section, according to second-order difference curvature approximation, under the constraint of an error upper limit epsilon, adaptively determining a step length for sampling, then performing uniform
resampling at a global
equidistant position, and performing linear calibration and quantization according to y '= alphay + beta to generate a waveform
lookup table; a DDS in the FPGA calculates a frequency control word FCW and a
phase control word POW according to a work
clock and a target frequency, a phase accumulator looks up a table to output a digital waveform, and finally the digital waveform is converted into an
analog signal by a DAC. According to the scheme, the
maximum error of the amplitude is controlled, meanwhile, the sample point and table scale is remarkably reduced, the bandwidth is reduced, the frequency and the phase are independently adjustable, and the expression ability and the freedom degree of waveform generation are greatly improved through a segmented expression.