Hi all,
I was using the bode plotter to characterize a system. I am curious how I can export the data from the bode plotter so that I can perform further analysis. If there is no existing method of doing so, could you point me to the lines where data are taken and I can maybe try to modify/add a few lines do to that.
Thanks!
Jialun
Exporting data from bode plotter
- redpitaya
- Site Admin
- Posts: 901
- Joined: Wed Mar 26, 2014 7:04 pm
Re: Exporting data from bode plotter
Hi,
There is no tool in bode app. to export measured data.
But, you can use Matlab/Octave to call bode from your PC directly.
Here is the example!!
Best
clear all;
close all;
clc
chanel = '1';
apmlitude = '1';
DC_bias = '0';
averaging = '1';
steps = '50';
start_freq = '1000';
stop_freq = '1000000';
scale_type = '1';
user = 'root';
ip = '192.168.178.114'; %set the IP of your board
%% Important: Before using bode from matlab, start Oscilloscope application from web interface to load correct fpga image!!!
%% Windows
% Download putty from link here> http://www.chiark.greenend.org.uk/~sgta ... nload.html
% C:\Path\to\plink is the path to plink where you have saved it on your PC.
% Cal bode from Matlab on Windows
% command=['"C:\Path\to\plink" -l root -pw root ',ip,' "/opt/redpitaya/bin/bode ',chanel,' ',apmlitude,' ',DC_bias,' ',averaging,' ',steps,' ',start_freq,' ',stop_freq,' ',scale_type,'"']
%% Linux
% Install putty on your PC
% Go to terminal and type >> sudo apt-get install putty <<
% Cal bode from Matlab on Linux
command=['"plink" -l root -pw root ',ip,' "/opt/redpitaya/bin/bode ',chanel,' ',apmlitude,' ',DC_bias,' ',averaging,' ',steps,' ',start_freq,' ',stop_freq,' ',scale_type,'"']
%% Notice,when you executing "command" line for the first time you will need to confirm executionin in the terminal(linux) or cmd(windows).
% in order to do that, just uncomment "command" line for desired OS, run
% matlab skript and from the >>matlab's command window<< coppy the printed line in to
% cmd or terminal, hit enter and confirm the execution.
% This step needs to be done each time your board gets an diffrent IP
[c,data] = dos(command);
data=str2num(data);
%depending on scale type graphs have linear or logarithmic scale
if (str2num(scale_type)) == 0
figure
subplot(2,1,1)
plot(data(:,1),data(:,3),'-ro')
ylabel('Gain / dB ')
xlabel(' No. of Measurments')
grid on
subplot(2,1,2)
plot(data(:,1),data(:,2),'-o')
ylabel('Phase / deg ')
xlabel('No. of Measurments')
grid on
elseif (str2num(scale_type)) == 1
figure
subplot(2,1,1)
semilogx(data(:,1),data(:,3),'-ro')
ylabel('Gain / dB ')
xlabel(' Frequency / Hz')
grid on
subplot(2,1,2)
semilogx(data(:,1),data(:,2),'-o')
ylabel('Phase / deg')
xlabel(' Frequency / Hz')
grid on
end;
There is no tool in bode app. to export measured data.
But, you can use Matlab/Octave to call bode from your PC directly.
Here is the example!!
Best
clear all;
close all;
clc
chanel = '1';
apmlitude = '1';
DC_bias = '0';
averaging = '1';
steps = '50';
start_freq = '1000';
stop_freq = '1000000';
scale_type = '1';
user = 'root';
ip = '192.168.178.114'; %set the IP of your board
%% Important: Before using bode from matlab, start Oscilloscope application from web interface to load correct fpga image!!!
%% Windows
% Download putty from link here> http://www.chiark.greenend.org.uk/~sgta ... nload.html
% C:\Path\to\plink is the path to plink where you have saved it on your PC.
% Cal bode from Matlab on Windows
% command=['"C:\Path\to\plink" -l root -pw root ',ip,' "/opt/redpitaya/bin/bode ',chanel,' ',apmlitude,' ',DC_bias,' ',averaging,' ',steps,' ',start_freq,' ',stop_freq,' ',scale_type,'"']
%% Linux
% Install putty on your PC
% Go to terminal and type >> sudo apt-get install putty <<
% Cal bode from Matlab on Linux
command=['"plink" -l root -pw root ',ip,' "/opt/redpitaya/bin/bode ',chanel,' ',apmlitude,' ',DC_bias,' ',averaging,' ',steps,' ',start_freq,' ',stop_freq,' ',scale_type,'"']
%% Notice,when you executing "command" line for the first time you will need to confirm executionin in the terminal(linux) or cmd(windows).
% in order to do that, just uncomment "command" line for desired OS, run
% matlab skript and from the >>matlab's command window<< coppy the printed line in to
% cmd or terminal, hit enter and confirm the execution.
% This step needs to be done each time your board gets an diffrent IP
[c,data] = dos(command);
data=str2num(data);
%depending on scale type graphs have linear or logarithmic scale
if (str2num(scale_type)) == 0
figure
subplot(2,1,1)
plot(data(:,1),data(:,3),'-ro')
ylabel('Gain / dB ')
xlabel(' No. of Measurments')
grid on
subplot(2,1,2)
plot(data(:,1),data(:,2),'-o')
ylabel('Phase / deg ')
xlabel('No. of Measurments')
grid on
elseif (str2num(scale_type)) == 1
figure
subplot(2,1,1)
semilogx(data(:,1),data(:,3),'-ro')
ylabel('Gain / dB ')
xlabel(' Frequency / Hz')
grid on
subplot(2,1,2)
semilogx(data(:,1),data(:,2),'-o')
ylabel('Phase / deg')
xlabel(' Frequency / Hz')
grid on
end;
-
- Posts: 20
- Joined: Fri Sep 09, 2016 3:34 pm
Re: Exporting data from bode plotter
Ah! Thanks for the suggestion. I will try it.
-
- Posts: 12
- Joined: Tue Sep 26, 2017 10:55 am
Re: Exporting data from bode plotter
Hi,
I adapted the source code to my configuration and Windows 10. In MATLAB, it works perfectly. (By the way, I started Bode app instead of Oscilloscope app.)
But the company has to use Scilab instead of MATLAB due to financial reasons.
Therefore, I translated the script using Scilab Help.
Problem: The variable "data" keeps empty.
The unix_g-command seems not to wait for returning values.
Any ideas? Thanks in advance!
I adapted the source code to my configuration and Windows 10. In MATLAB, it works perfectly. (By the way, I started Bode app instead of Oscilloscope app.)
But the company has to use Scilab instead of MATLAB due to financial reasons.
Therefore, I translated the script using Scilab Help.
Code: Select all
clc; clear; xdel(winsid());
// Important:
// Before using bode from MATLAB, start Oscilloscope application from web interface to load correct fpga image!
// measurement parameters
channel = '1';
amplitude = '1';
DC_bias = '0';
averaging = '1';
steps = '25';
start_freq = '1000';
stop_freq = '10000';
scale_type = '1';
// Red Pitaya login
ip = '192.168.1.100';
user = 'root';
pw = 'root';
plink_path = '""C:\Program Files\PuTTY\plink.exe""';
app_path = '/opt/redpitaya/bin/bode';
// Windows command line
plink_command = strcat([plink_path,' -l ',user',' -pw ', pw,' ',ip]);
app_command = strcat(['""',app_path,' ',channel,' ',amplitude,' ',DC_bias,' ',averaging,' ',steps,' ',start_freq,' ',stop_freq,' ',scale_type,'""']);
command = strcat([plink_command,' ',app_command]);
[c,data]=unix_g(command);
The unix_g-command seems not to wait for returning values.
Any ideas? Thanks in advance!
-
- Posts: 12
- Joined: Tue Sep 26, 2017 10:55 am
Re: Exporting data from bode plotter
I tried to measure the frequency response of an open-looped buck-converter. Therefore, I need a DC-biased signal to stimulate the DUT.
It works by using Bode Analyzer-App - problem: no data export.
Using /opt/redpitaya/bin/bode, the DC-bias is missing!
Is there any solution?
Used setting:
Addition: The "synthesize_signal"-function in bode.c is the problem - it doesn't take care of the DC-bias.
It works by using Bode Analyzer-App - problem: no data export.
Using /opt/redpitaya/bin/bode, the DC-bias is missing!
Is there any solution?
Used setting:
Code: Select all
channel = '1';
amplitude = '0.1';
DC_bias = '0.5';
averaging = '10';
steps = '100';
start_freq = '50';
stop_freq = '5000';
scale_type = '1';
-
- Posts: 2
- Joined: Tue May 08, 2018 2:53 pm
Re: Exporting data from bode plotter
Thanks! i have no clue what kind of software or expoting tool i had before
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie
Who is online
Users browsing this forum: No registered users and 32 guests