File: plot_samples.m

package info (click to toggle)
bladerf 0.2024.05-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 245,984 kB
  • sloc: ansic: 361,923; vhdl: 28,167; tcl: 14,424; python: 3,668; sh: 1,811; makefile: 1,255; xml: 1,020; cpp: 473; asm: 158; csh: 18
file content (25 lines) | stat: -rw-r--r-- 810 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
% This script assumes it is being run from:
%   ${BLADERF}/host/examples/bladeRF-cli/sync_trx
%
% If this is not the case, change the following addpath() line to point to: 
%    ${BLADERF}/host/misc/matlab
% 
% This directory contains the load_csv() function.
addpath('../../../misc/matlab')

master_tx = load_csv('master_tx.csv');
master_rx = load_csv('master_rx.csv');
slave_rx  = load_csv('slave_rx.csv');

master_tx_len = length(master_tx);
master_rx_len = length(master_rx);
slave_rx_len  = length(slave_rx);

% Scale the master_tx samples to the max RX'd amplitude
% just to make the plot a bit easier to read.
abs_master_tx = abs(master_tx) * max(abs(master_rx));

plot(1:master_tx_len, abs_master_tx, 'r', ... 
     1:master_rx_len, abs(master_rx), 'g', ...
     1:slave_rx_len,  abs(slave_rx), 'b');