LFM signal analysis and processing¶
Introduction¶
Consider a small model containing a linear frequency modulated (LFM) signal generator block and a discrete filter block with finite impulse response (FIR filter). In this model, we can clearly observe the process of passing a signal, the frequency of which increases linearly over the course of the simulation, through a frequency-selective circuit: the low-pass filter (LPF).

The parameters of the signal source block ChirpDSP
are shown in the screenshot of the model. We generate a signal whose frequency linearly increases from 0.1 Hz to 999 Hz during 20 seconds of simulation. The signal is discrete, with a sampling rate of 2 kHz (which allows us to fulfil the basic condition of Kotelnikov's theorem).
Characteristics of the low-pass filter¶
Block DiscreteFIRFilter
in the model stores the coefficients of the numerator of the transfer function of the prototype filter, which we create using functions from the library DSP.jl
. Let's specify the cut-off frequency of the filter in 500 Hz, the type of window function for synthesis, as well as the filter order:
We then calculate and display the amplitude-frequency response (AFR) of the filter to ensure that it can only pass signals with frequencies no higher than 500 Hz:
We use a 32nd-order window filter without controlling the sharpness of the transition from passband to obstruction bandwidth. But an attenuation of -6 dB at the 500 Hz boundary is fine with us. Thus, we have obtained a frequency selective circuit that allows the low frequencies of our LFM signal to pass through.
Simulation of the model¶
It should be noted that before running the model there is no need to synthesise the LFM coefficients each time, they are automatically loaded into the discrete filter block when loading the model. And visual analysis of the results of generation and filtering of LFM-signal we will observe in the window Графики
of the modelling environment interface.
The main parameters of simulation are set so that the speed of calculation and display corresponds to the "wall clock" - 1 second of simulation is equal to 1 second of elapsed time. And in the window of graphs we can observe how at the start of simulation the peaks of spectra of generated and processed signals move to the right on the frequency axis, and the amplitude of the output signal starts to decrease after passing the 500 Hz mark.

To observe the non-stationary spectrum, we used the built-in signal visualisation tool in the frequency domain.
Circuit analysis using LFM signal¶
Historically, linearly increasing frequency signals have been used to analyse the frequency response of an unknown circuit. In the case where the amplitude of the LFM signal does not change over the observation period, the shape of the output signal in the time domain reflects the frequency response. Before the development of digital algorithms for spectral analysis, such experiments could be performed using an analogue oscilloscope.
In the Графики
window, let's switch to displaying signals in the time domain. Despite the fact that we are modelling a discrete signal and a digital filter, the principle remains the same, and we expect to see the shape of the signal in time, reflecting the filter's AFC.

Indeed, after about 10 seconds of simulation, the output signal is suppressed to zero (during this time its frequency reaches a value of 500 Hz). However, if we approach the region of the beginning of the simulation time, it is possible to observe the delay, spike and beats of the output signal. This is because the digital FIR filter will necessarily delay the output signal by its length (filter order, in samples of the discrete signal), and it also contains certain initial states of its registers. In the default model, the block DiscreteFIRFilter
has zero initial states (parameter Initial states
). If we change this value to 1, we will see that now the filter does not need to "catch up" the sharply changed signal at its input, bursts and beats are not observed.

Conclusion¶
This model has clearly demonstrated the principles of generating time-varying spectral signals, visualising signal spectra using the built-in tools of the simulation environment, and has also shown the principle of analysing the AFC of circuits using LFM signals.
{"id": "6609da6f-25e3-4298-8f08-c3d0d29967c4", "data": [{"showlegend": true, "mode": "lines", "xaxis": "x", "colorbar": {"y": 0.5086805555555556, "title": {"text": ""}, "len": 0.8657316272965879, "x": 0.9934383202099738}, "name": "y1", "yaxis": "y", "legendgroup": "y1", "line": {"color": "rgba(0, 154, 250, 1.000)", "shape": "linear", "dash": "solid", "width": 3}, "y": [3.085847892970513e-14, -2.6852115557684166e-05, -0.00010627539370579623, -0.00023491382830526688, -0.0004073165733594886, -0.0006161465061376602, -0.0008524620081577105, -0.0011060621366456125, -0.0013658830841879565, -0.0016204319215066343, -0.001858242177434988, -0.0020683348505291994, -0.0022406680378688135, -0.0023665585143040242, -0.002439059310236032, -0.00245327860916239, -0.0024066270791690686, -0.0022989830259282995, -0.0021327674325693096, -0.0019129239569024782, -0.001646802194357117, -0.0013439458784787446, -0.0010157910724457769, -0.0006752826894515995, -0.0003364207610833121, -1.3750641636119994e-05, 0.0002781862984504987, 0.0005254230606104291, 0.0007151387375661779, 0.000836211103027788, 0.0008797295422383404, 0.0008394483866638951, 0.0007121619698341311, 0.000497984616467833, 0.000200521278309379, -0.00017308241027364705, -0.0006122183397631798, -0.0011030261269998891, -0.0016287347832010161, -0.002170130865558626, -0.0027061435988208287, -0.003214532985079358, -0.0036726626502333916, -0.004058335257669517, -0.004350664892692583, -0.0045309580362626525, -0.004583572727452236, -0.00449672438289591, -0.004263206588548629, -0.0038809960665631667, -0.0033537129854616697, -0.0026909108076726236, -0.0019081739207903597, -0.0010270062824924424, -7.450010872345942e-05, 0.0009172199041244046, 0.001911774389605158, 0.0028695194890562743, 0.003748732418509862, 0.004506968251914175, 0.005102556873871123, 0.005496202678192066, 0.005652643879371779, 0.005542323401114695, 0.00514301934048206, 0.004441380077233101, 0.00343430730947992, 0.0021301297257972775, 0.0005495107582035448, -0.001273964022307892, -0.003293570723755913, -0.00544964789526552, -0.007670253226808465, -0.009872306779517247, -0.011963241264732584, -0.01384316817623089, -0.015407555337754602, -0.016550396869642818, -0.017167841011943036, -0.01716222511247236, -0.016446450957840184, -0.014948618173186072, -0.01261681941181052, -0.009423989317478306, -0.005372690590043498, -0.0004997156648318724, 0.0051196178561612425, 0.011367595404482124, 0.018080765189990817, 0.02504722310527398, 0.03200459776429787, 0.03863878845943858, 0.04458348413091989, 0.04942046548887414, 0.05268066655015634, 0.05384594736135576, 0.0523515077941763, 0.04758885401331131, 0.03890921526624279, 0.025627299436701032, 0.007025271436930585, -0.017643161237045523, -0.04914866705997506, -0.0882823165413945, -0.13585180864817004, -0.19267797806833536, -0.2595916504625892, -0.3374308993297515, -0.42703874509876427, -0.5292613251083762, -0.6449465526788566, -0.7749432748168674, -0.9201009314056883, -1.0812697141042606, -1.2593012206244327, -1.45504959953874, -1.669373182237083, -1.9031366020417504, -2.1572134057817856, -2.4324891703349087, -2.729865145861482, -3.050262458862493, -3.394626922102692, -3.763934515314155, -4.159197621104871, -4.581472125575845, -5.031865524087866, -5.511546211177249, -6.021754182212595, -6.563813436339965, -7.13914645017243, -7.749291195985434, -8.39592131596172, -9.080870248300931, -9.806160350620685, -10.574038408777408, -11.387019396516973, -12.247941026345996, -13.160032602582373, -14.127003108651927, -15.153155583341873, -16.24353808182733, -17.404146589113537, -18.642203411708305, -19.96654811107728, -21.388201320035535, -22.92120348354166, -24.583908933253937, -26.401071584128637, -28.407390580017907, -30.653953936966168, -33.22100545417407, -36.24637880864684, -40.00051483943126, -45.14702540415186, -54.358250396517754, -60.6730676617769, -50.24734322248764, -46.723507459618475, -45.00668135281445, -44.187962858440635, -43.94202043676428, -44.12248895092493, -44.65981952387807, -45.527112392095006, -46.728954148318884, -48.30250257995294, -50.33174481241041, -52.98920452831738, -56.66473642590204, -62.52323016436214, -80.04777587339588, -66.67332607040677, -60.599339809084356, -57.68816484383148, -56.03590010017762, -55.10656555594578, -54.677805520382336, -54.6421422286297, -54.9471372143588, -55.57375288602657, -56.52961393581287, -57.85150031680091, -59.61907817943882, -61.992831075097776, -65.32729642661735, -70.63506586652903, -84.38831513295054, -76.34068178326575, -69.4001639239474, -66.10749584283369, -64.17459391139619, -63.001924281114, -62.34646330753887, -62.0909216178591, -62.17633862855192, -62.57763292387108, -63.2950012473311, -64.35398355826018, -65.81424607832967, -67.79444811577333, -70.5409555812352, -74.66448463648952, -82.52706269741721, -90.6089974274058, -78.07806102413531, -73.6163373670526, -71.09337530056693, -69.518137354107, -68.54020427925774, -67.99915632391765, -67.81341628245492, -67.94244291372519, -68.3722553789855, -69.11111149420942, -70.19212808046036, -71.68475469835553, -73.7249235304136, -76.59988846263172, -81.05997032216015, -90.5228149408819, -91.55862961747198, -82.10903925873134, -78.07190237122826, -75.6751675071848, -74.1277179902057, -73.12972671232215, -72.53884227539275, -72.28073305477528, -72.31725980632322, -72.63383994346711, -73.23531951716049, -74.14750152785942, -75.42535135302853, -77.17411256494798, -79.60472052222862, -83.2117270913936, -89.66136428474583, -110.78004213274232, -88.58649611025865, -83.20228275482991, -80.18026789277015, -78.21079049814435, -76.86881797176913, -75.96513570222709, -75.40233218991347, -75.12770337460455, -75.11467265753848, -75.35519706236354, -75.85777100144875, -76.64980136668254, -77.7858190121162, -79.36745751404435, -81.59460860147469, -84.92535215780987, -90.83244496551949, -332.44870791247024], "type": "scatter", "x": [0, 3.90625, 7.8125, 11.71875, 15.625, 19.53125, 23.4375, 27.34375, 31.25, 35.15625, 39.0625, 42.96875, 46.875, 50.78125, 54.6875, 58.59375, 62.5, 66.40625, 70.3125, 74.21875, 78.125, 82.03125, 85.9375, 89.84375, 93.75, 97.65625, 101.5625, 105.46875, 109.375, 113.28125, 117.1875, 121.09375, 125, 128.90625, 132.8125, 136.71875, 140.625, 144.53125, 148.4375, 152.34375, 156.25, 160.15625, 164.0625, 167.96875, 171.875, 175.78125, 179.6875, 183.59375, 187.5, 191.40625, 195.3125, 199.21875, 203.125, 207.03125, 210.9375, 214.84375, 218.75, 222.65625, 226.5625, 230.46875, 234.375, 238.28125, 242.1875, 246.09375, 250, 253.90625, 257.8125, 261.71875, 265.625, 269.53125, 273.4375, 277.34375, 281.25, 285.15625, 289.0625, 292.96875, 296.875, 300.78125, 304.6875, 308.59375, 312.5, 316.40625, 320.3125, 324.21875, 328.125, 332.03125, 335.9375, 339.84375, 343.75, 347.65625, 351.5625, 355.46875, 359.375, 363.28125, 367.1875, 371.09375, 375, 378.90625, 382.8125, 386.71875, 390.625, 394.53125, 398.4375, 402.34375, 406.25, 410.15625, 414.0625, 417.96875, 421.875, 425.78125, 429.6875, 433.59375, 437.5, 441.40625, 445.3125, 449.21875, 453.125, 457.03125, 460.9375, 464.84375, 468.75, 472.65625, 476.5625, 480.46875, 484.375, 488.28125, 492.1875, 496.09375, 500, 503.90625, 507.8125, 511.71875, 515.625, 519.53125, 523.4375, 527.34375, 531.25, 535.15625, 539.0625, 542.96875, 546.875, 550.78125, 554.6875, 558.59375, 562.5, 566.40625, 570.3125, 574.21875, 578.125, 582.03125, 585.9375, 589.84375, 593.75, 597.65625, 601.5625, 605.46875, 609.375, 613.28125, 617.1875, 621.09375, 625, 628.90625, 632.8125, 636.71875, 640.625, 644.53125, 648.4375, 652.34375, 656.25, 660.15625, 664.0625, 667.96875, 671.875, 675.78125, 679.6875, 683.59375, 687.5, 691.40625, 695.3125, 699.21875, 703.125, 707.03125, 710.9375, 714.84375, 718.75, 722.65625, 726.5625, 730.46875, 734.375, 738.28125, 742.1875, 746.09375, 750, 753.90625, 757.8125, 761.71875, 765.625, 769.53125, 773.4375, 777.34375, 781.25, 785.15625, 789.0625, 792.96875, 796.875, 800.78125, 804.6875, 808.59375, 812.5, 816.40625, 820.3125, 824.21875, 828.125, 832.03125, 835.9375, 839.84375, 843.75, 847.65625, 851.5625, 855.46875, 859.375, 863.28125, 867.1875, 871.09375, 875, 878.90625, 882.8125, 886.71875, 890.625, 894.53125, 898.4375, 902.34375, 906.25, 910.15625, 914.0625, 917.96875, 921.875, 925.78125, 929.6875, 933.59375, 937.5, 941.40625, 945.3125, 949.21875, 953.125, 957.03125, 960.9375, 964.84375, 968.75, 972.65625, 976.5625, 980.46875, 984.375, 988.28125, 992.1875, 996.09375, 1000], "zaxis": null, "z": null, "metadata": {"shouldEnableSmartZoom": false, "smartZoomParams": {"minCount": 25000, "maxCount": 257, "currentCount": 257}}}], "config": {"showlegend": true, "xaxis": {"showticklabels": true, "gridwidth": 0.5, "tickvals": [0, 250, 500, 750, 1000], "range": [-30, 1030], "domain": [0.09128390201224845, 0.9934383202099738], "mirror": false, "tickangle": 0, "showline": true, "ticktext": ["0", "250", "500", "750", "1000"], "zeroline": false, "tickfont": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 11}, "zerolinecolor": "rgba(0, 0, 0, 1)", "anchor": "y", "visible": true, "ticks": "inside", "tickmode": "array", "linecolor": "rgba(0, 0, 0, 1)", "showgrid": true, "title": {"text": "Частота, Гц", "font": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 15}}, "gridcolor": "rgba(0, 0, 0, 0.1)", "tickcolor": "rgb(0, 0, 0)", "type": "linear"}, "paper_bgcolor": "rgba(255, 255, 255, 1.000)", "annotations": [{"yanchor": "top", "xanchor": "center", "rotation": 0, "y": 1, "font": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 20}, "yref": "paper", "showarrow": false, "text": "АЧХ фильтра нижних частот", "xref": "paper", "x": 0.5423611111111111}], "height": 400, "margin": {"l": 0, "b": 20, "r": 0, "t": 20}, "plot_bgcolor": "rgba(255, 255, 255, 1.000)", "yaxis": {"showticklabels": true, "gridwidth": 0.5, "tickvals": [-100, -75, -50, -25, 0], "range": [-120, 10], "domain": [0.07581474190726165, 0.9415463692038496], "mirror": false, "tickangle": 0, "showline": true, "ticktext": ["-100", "-75", "-50", "-25", "0"], "zeroline": false, "tickfont": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 11}, "zerolinecolor": "rgba(0, 0, 0, 1)", "anchor": "x", "visible": true, "ticks": "inside", "tickmode": "array", "linecolor": "rgba(0, 0, 0, 1)", "showgrid": true, "title": {"text": "Амплитуда, дБ", "font": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 15}}, "gridcolor": "rgba(0, 0, 0, 0.1)", "tickcolor": "rgb(0, 0, 0)", "type": "linear"}, "legend": {"yanchor": "auto", "xanchor": "auto", "bordercolor": "rgba(0, 0, 0, 1)", "bgcolor": "rgba(255, 255, 255, 1.000)", "borderwidth": 1, "tracegroupgap": 0, "y": 1, "font": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 11}, "title": {"font": {"color": "rgba(0, 0, 0, 1)", "family": "sans-serif", "size": 15}, "text": ""}, "traceorder": "normal", "x": 1}, "width": 805.5}}