Title(sprintf('Channel %d: SNR = %.2f dB',channelNumber,SNR)) Īmplitude, offset, freqHz/1e3, angleRad/2/pi*360). = sinefit(data,t,freq,verbose,plot_flag) įunction annotatePlot(figId,channelNumber,SNR,offset,amplitude,freqHz,angleRad) ĬalculateSNR(data(:,channelNumber),freq,sampleRate) ĪnnotatePlot(figureId,channelNumber,SNR,offset,amplitude,freqHz,angleRad) įunction =. params(1)ĭata=acquire(ipAddress,nSamples,decimationFactor,averagingIsEnabled) įprintf("Acquired %d samples\n",length(data)) The returned parameters are described in the table below. = sinefit(data,t,freq,verbose,plot_flag) The SNR can then be calculated from the equation:Īs input to sinefit we just enter the acquired samples vector (data), the time vector (t) and the estimated sine wave frequency (freq). m files.ĬalculateSNRcalls the sinefitfunction to fit a sine wave to the acquired data (using a least squares method) and returns the sine wave (signal) parameters and information about the residual (noise) signal. m file so that it can be called from other. The calculateSNR function could also be saved into a separate. The functions calculateSNRand annotatePlotcan be saved into the same source file (analyzeSNR.m). It then plots the sample vector, calls the calculateSNR function and finally annotates the returned SNR value to the plot. It first acquires samples from the RedPitaya by calling the acquirefunction (line 10). The main function is called analyzeSNR(shown below). WinCommand= ĭisp('- set the averaging FPGA register') fflush(stdout) įunction acquireDataIntoFile(ipAddress,dataFile,nSamples,decimationFactor)įunction data = loadDataFromFile(fileName)Īs an example let’s see how the acquire function can be used to measure the signal-to-noise ratio (SNR) of a captured signal. SetAveragingRegister(ipAddress, averagingIsEnabled) ĪcquireDataIntoFile(ipAddress,DATA_FILE,nSamples,decimationFactor) įunction notInstalled = puttyIsNotInstalledįunction setAveragingRegister(ipAddress, averagingIsEnabled)
#Vivado hls gnu octave install#
%> data Acquired data (two columns, channels 1 and 2).įunction data=acquire(ipAddress,nSamples,decimationFactor,averagingIsEnabled)ĭisp('plink.exe not found, please install PuTTy!') %> averagingIsEnabled If true, enable averaging when decimating.
![vivado hls gnu octave vivado hls gnu octave](https://www.allaboutcircuits.com/uploads/articles/Fig2m822018.png)
%> nSamples Number of samples to capture. %> ipAddress Red Pitaya IP address (or hostname).
#Vivado hls gnu octave windows#
%> installation folder must be in included into the windows %> Note: PuTTy must be installed and the path to the PuTTY 16384), the optional decimation factor and averaging selection.Īs I’m running Octave on windows the PuTTy tool must also be installed to be able to transfer data over an SSH connection.
![vivado hls gnu octave vivado hls gnu octave](https://cdn.imperix.com/doc/wp-content/uploads/2021/08/5.png)
![vivado hls gnu octave vivado hls gnu octave](https://www.xilinx.com/content/dam/xilinx/imgs/products/model-composer/vitis-model-composer.png)
As input it needs the RedPitaya IP address, the number of samples to acquire (max. The function acquire shown below is a simple GNU Octave script that loads samples from the RedPitaya and returns the sample vectors as a two-column matrix. We can use the GNU Octave tool to acquire samples from the RedPitaya and then do basically whatever processing we want.