Post Go back to editing

AD9361 FIR Filter configuration with Matlab

I use the Adalm Pluto SDR Active Learning Module,

for my thesis I am trying to configure the FIR Filter coefficients.

I already compiled a ftr. File but I can not transfer it on my chip.

 iio = iio_sys_obj_matlab;
 iio.ip_address = '192.168.2.1';
 iio.dev_name = 'ad9361';
 iio.in_ch_no = 1;
 iio.out_ch_no = 1;
 iio = iio.setupImpl();
 iio.writeFirData('somefilter.ftr');

Parents
  • Moved to Virtual Classroom. Pluto questions go here.

    -Travis

  • After a couple of attemps I went back to

    Latest commit f8c43e1 on 12 Oct
    with the files
    iio.h     
    iio_sys_obj.m     
    iio_sys_obj_matlab.m     
    libiio_if.m    
    libiio_if_daq2.m

    in my folder and now I get:

    Error using calllib
    Method was not found.

    Error in matlabshared.libiio.context/iio_create_scan_block

    Error in matlabshared.libiio.base/scanUSBContexts

    Error in comm.plutoradio.base/scanPlutoUSBContexts

    Error in comm.plutoradio.base/appendUSBPlutoCtx

    Error in comm.plutoradio.base/findPlutoUSB

    Error in comm.plutoradio.base/findPlutoURI

    Error in comm.plutoradio.base/resolvePlutoURI

    Error in comm.plutoradio.tx/resolveURI

    Error in matlabshared.libiio.base/get.resolvedURI

    Error in matlabshared.libiio.base/getContext

    Error in comm.libiio.AD9361.base/getContext

    Error in matlabshared.libiio.base/setupImpl

    Error in comm.libiio.AD9361.base/setupImpl

    Error in comm.libiio.AD9361.tx/setupImpl

    Error in comm.plutoradio.tx/setupImpl

    Error in comm.SDRTxPluto/setupImpl

    Error in TxPluto (line 54)
        step(radio, data);

  • You might have some lingering class instantiations. Try "clear all" or restart MATLAB.

    I've tried the same commits and everything worked fine for me.  After running your code, can you login to Pluto over ssh and get the output of dmesg?

    -Travis

  • login as: root
    root@192.168.2.1's password:
    Welcome to:
    ______ _       _        _________________
    | ___ \ |     | |      /  ___|  _  \ ___ \
    | |_/ / |_   _| |_ ___ \ `--.| | | | |_/ /
    |  __/| | | | | __/ _ \ `--. \ | | |    /
    | |   | | |_| | || (_) /\__/ / |/ /| |\ \
    \_|   |_|\__,_|\__\___/\____/|___/ \_| \_|

    v0.28
    wiki.analog.com/.../pluto
    # dmesg
    Booting Linux on physical CPU 0x0
    Linux version 4.9.0-10315-gb07f3c6 (michael@mhenneri-D06) (gcc version 4.9.2 (Sourcery CodeBench Lite 2015.05-17) ) #234 SMP PREEMPT Tue Apr 24 13:47:24 CEST 2018
    CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
    CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    OF: fdt:Machine model: Analog Devices PlutoSDR Rev.B (Z7010/AD9363)
    cma: Reserved 256 MiB at 0x0e400000
    Memory policy: Data cache writealloc
    On node 0 totalpages: 131072
    free_area_init_node: node 0, pgdat c0654e40, node_mem_map dfb77000
      Normal zone: 1024 pages used for memmap
      Normal zone: 0 pages reserved
      Normal zone: 131072 pages, LIFO batch:31
    percpu: Embedded 13 pages/cpu @dfb51000 s23744 r8192 d21312 u53248
    pcpu-alloc: s23744 r8192 d21312 u53248 alloc=13*4096
    pcpu-alloc: [0] 0 [0] 1
    Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 130048
    Kernel command line: console=ttyPS0,115200 maxcpus=1 rootfstype=ramfs root=/dev/ram0 rw quiet loglevel=4 uboot=U-Boot PlutoSDR v0.20-PlutoSDR-00043-gefdb9e8 (Dec 18 2017 - 18:25:09 +0100)
    PID hash table entries: 2048 (order: 1, 8192 bytes)
    Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
    Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
    Memory: 245148K/524288K available (4564K kernel code, 246K rwdata, 1244K rodata, 232K init, 150K bss, 16996K reserved, 262144K cma-reserved, 0K highmem)
    Virtual kernel memory layout:
        vector  : 0xffff0000 - 0xffff1000   (   4 kB)
        fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
        vmalloc : 0xe0800000 - 0xff800000   ( 496 MB)
        lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
        pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
        modules : 0xbf000000 - 0xbfe00000   (  14 MB)
          .text : 0xc0008000 - 0xc047d3dc   (4565 kB)
          .init : 0xc05de000 - 0xc0618000   ( 232 kB)
          .data : 0xc0618000 - 0xc0655a40   ( 247 kB)
           .bss : 0xc0655a40 - 0xc067b3d0   ( 151 kB)
    Preemptible hierarchical RCU implementation.
            Build-time adjustment of leaf fanout to 32.
            RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
    RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=2
    NR_IRQS:16 nr_irqs:16 16
    efuse mapped to e0800000
    slcr mapped to e0802000
    L2C: platform modifies aux control register: 0x72360000 -> 0x72760000
    L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000
    L2C-310 erratum 769419 enabled
    L2C-310 enabling early BRESP for Cortex-A9
    L2C-310 full line of zeros enabled for Cortex-A9
    L2C-310 ID prefetch enabled, offset 1 lines
    L2C-310 dynamic clock gating enabled, standby mode enabled
    L2C-310 cache controller enabled, 8 ways, 512 kB
    L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001
    zynq_clock_init: clkc starts at e0802100
    Zynq clock init
    sched_clock: 64 bits at 333MHz, resolution 3ns, wraps every 4398046511103ns
    clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x4ce07af025, max_idle_ns: 440795209040 ns
    Switching to timer-based delay loop, resolution 3ns
    clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 537538477 ns
    timer #0 at e080a000, irq=17
    Console: colour dummy device 80x30
    Calibrating delay loop (skipped), value calculated using timer frequency.. 666.66 BogoMIPS (lpj=3333333)
    pid_max: default: 32768 minimum: 301
    Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
    Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
    CPU: Testing write buffer coherency: ok
    CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
    Setting up static identity map for 0x82c0 - 0x8318
    Brought up 1 CPUs
    SMP: Total of 1 processors activated (666.66 BogoMIPS).
    CPU: All CPU(s) started in SVC mode.
    devtmpfs: initialized
    VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
    clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    pinctrl core: initialized pinctrl subsystem
    NET: Registered protocol family 16
    DMA: preallocated 256 KiB pool for atomic coherent allocations
    cpuidle: using governor ladder
    hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
    hw-breakpoint: maximum watchpoint size is 4 bytes.
    zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0xe0840000
    zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
    SCSI subsystem initialized
    usbcore: registered new interface driver usbfs
    usbcore: registered new interface driver hub
    usbcore: registered new device driver usb
    EDAC MC: Ver: 3.0.0
    clocksource: Switched to clocksource arm_global_timer
    NET: Registered protocol family 2
    TCP established hash table entries: 4096 (order: 2, 16384 bytes)
    TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
    TCP: Hash tables configured (established 4096 bind 4096)
    UDP hash table entries: 256 (order: 1, 8192 bytes)
    UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
    NET: Registered protocol family 1
    Trying to unpack rootfs image as initramfs...
    Freeing initrd memory: 5152K (de621000 - deb29000)
    hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
    futex hash table entries: 512 (order: 3, 32768 bytes)
    workingset: timestamp_bits=30 max_order=17 bucket_order=0
    io scheduler noop registered
    io scheduler deadline registered
    io scheduler cfq registered (default)
    e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 25, base_baud = 6249999) is a xuartps
    console [ttyPS0] enabled
    xdevcfg f8007000.devcfg: ioremap 0xf8007000 to e0818000
    brd: module loaded
    loop: module loaded
    m25p80 spi32765.0: SPI-NOR-UniqueID 104400b839910018fdff1d00208a656489
    m25p80 spi32765.0: found n25q512a, expected n25q256a
    m25p80 spi32765.0: n25q512a (65536 Kbytes)
    4 ofpart partitions found on MTD device spi32765.0
    Creating 4 MTD partitions on "spi32765.0":
    0x000000000000-0x000000100000 : "qspi-fsbl-uboot"
    0x000000100000-0x000000120000 : "qspi-uboot-env"
    0x000000120000-0x000000200000 : "qspi-nvmfs"
    0x000000200000-0x000002000000 : "qspi-linux"
    libphy: Fixed MDIO Bus: probed
    usbcore: registered new interface driver rt2500usb
    usbcore: registered new interface driver rt73usb
    usbcore: registered new interface driver rt2800usb
    usbcore: registered new interface driver rtl8187
    usbcore: registered new interface driver rtl8192cu
    usbcore: registered new interface driver rtl8xxxu
    usbcore: registered new interface driver r8152
    usbcore: registered new interface driver lan78xx
    usbcore: registered new interface driver asix
    usbcore: registered new interface driver ax88179_178a
    usbcore: registered new interface driver smsc75xx
    usbcore: registered new interface driver smsc95xx
    ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    usbcore: registered new interface driver usb-storage
    usbcore: registered new interface driver usbserial
    usbcore: registered new interface driver usbserial_generic
    usbserial: USB Serial support registered for generic
    usbcore: registered new interface driver ftdi_sio
    usbserial: USB Serial support registered for FTDI USB Serial Device
    e0002000.usb supply vbus not found, using dummy regulator
    ULPI transceiver vendor/product ID 0x0424/0x0007
    Found SMSC USB3320 ULPI transceiver.
    ULPI integrity check: passed.
    mousedev: PS/2 mouse device common for all mice
    i2c /dev entries driver
    cdns-wdt f8005000.watchdog: Xilinx Watchdog Timer at e083a000 with timeout 10s
    Xilinx Zynq CpuIdle Driver started
    ledtrig-cpu: registered to indicate activity on CPUs
    hidraw: raw HID events driver (C) Jiri Kosina
    usbcore: registered new interface driver usbhid
    usbhid: USB HID core driver
    usbcore: registered new interface driver r8712u
    usbcore: registered new interface driver r8188eu
    ad9361 spi32766.0: ad9361_probe : enter (ad9363a)
    random: fast init done
    ad9361 spi32766.0: ad9361_probe : AD936x Rev 2 successfully initialized
    cf_axi_dds 79024000.cf-ad9361-dds-core-lpc: Analog Devices CF_AXI_DDS_DDS MASTER (9.00.b) at 0x79024000 mapped to 0xe083e000, probed DDS AD9364
    NET: Registered protocol family 17
    Registering SWP/SWPB emulation handler
    cf_axi_adc 79020000.cf-ad9361-lpc: ADI AIM (10.00.b) at 0x79020000 mapped to 0xe0938000, probed ADC AD9364 as MASTER
    input: gpio_keys as /devices/soc0/gpio_keys/input/input0
    Freeing unused kernel memory: 232K (c05de000 - c0618000)
    This architecture does not have kernel memory protection.
    file system registered
    using random self ethernet address
    using random host ethernet address
    Mass Storage Function, version: 2009/09/11
    LUN: removable file: (no medium)
    read descriptors
    read strings
    usb0: HOST MAC 00:e0:22:c1:2b:ab
    usb0: MAC 00:05:f7:b1:af:b1
    random: crng init done
    configfs-gadget gadget: high-speed config #1: c

  • Maybe it help to post my whole matlab code:

    function TxPluto(prmTransmitter)

    close all,


    %% Initialize SDR
    sdrdev('Pluto');

    %% Setup the iio_sys_obj
     iio = iio_sys_obj_matlab;
     iio.ip_address = '192.168.2.1';
     iio.dev_name = 'ad9361';
     iio.writeFirData('WorseFilter4MSPS.ftr');
     iio = iio.setupImpl();
     
    %%
    persistent Tx radio
    if isempty(Tx)
        % Initialize the components
        % Create and configure the transmitter System object
        Tx = QPSKTransmitter(...
            'UpsamplingFactor',             prmTransmitter.Interpolation, ...
            'RolloffFactor',                prmTransmitter.RolloffFactor, ...
            'RaisedCosineFilterSpan',       prmTransmitter.RaisedCosineFilterSpan, ...
            'MessageBits',                  prmTransmitter.MessageBits, ...
            'MessageLength',                prmTransmitter.MessageLength, ...
            'NumberOfMessage',              prmTransmitter.NumberOfMessage, ...
            'ScramblerBase',                prmTransmitter.ScramblerBase, ...
            'ScramblerPolynomial',          prmTransmitter.ScramblerPolynomial, ...
            'ScramblerInitialConditions',   prmTransmitter.ScramblerInitialConditions);
        
        % Create and configure the Pluto System object.
        radio = sdrtx('Pluto');    
            %designCustomFilter(radio);
            radio.RadioID                       = prmTransmitter.Address;
            radio.CenterFrequency               = prmTransmitter.PlutoCenterFrequency;
            radio.BasebandSampleRate            = prmTransmitter.PlutoFrontEndSampleRate;
            radio.SamplesPerFrame               = prmTransmitter.PlutoFrameLength;
            radio.Gain                          = prmTransmitter.PlutoGain;
            radio.ShowAdvancedProperties        = true;
            radio.UseCustomFilter               = true;
            

    end

    currentTime = 0;
        
        % Transmission Process
    while currentTime < prmTransmitter.StopTime
        % Bit generation, modulation and transmission filtering
        data = step(Tx);
        
        % Data transmission
        step(radio, data);


        % Update simulation time
        currentTime = currentTime+prmTransmitter.FrameTime;
    end
        
    release(Tx);
    release(radio);
    release(iio);

    end

  • You are using multiple system objects to talk to the same device. You must release your "iio" object before using the objects from MathWorks ( radio = sdrtx('Pluto'); ). Otherwise, they will block each other.

    If you want to use custom filters, MATLAB supports that directly: https://www.mathworks.com/help/supportpkg/xilinxzynqbasedradio/ug/comm.sdrtxad936x.designcustomfilter.html

    -Travis

  • When I release the object like

     iio = iio_sys_obj_matlab;
     iio.ip_address = '192.168.2.1';
     iio.dev_name = 'ad9361';
     iio.writeFirData('WorseFilter4MSPS.ftr');
     iio = iio.setupImpl();
     release(iio);

    I get the error :

    Undefined function 'release' for input arguments of type 'iio_sys_obj_matlab'.

    What is the proper why to realse the object ?

  • Use the method releaseImpl or clear the variable.

    -Travis

  •  iio = iio_sys_obj_matlab;
     iio.ip_address = '192.168.2.1';
     iio.dev_name = 'ad9361';
     iio.writeFirData('WorseFilter4MSPS.ftr');
     iio.setupImpl();
     releaseImpl(iio);

    But the .ftr file does not get loaded to the Ad9363

    Worse Filter has 64 tabs

    And I get

    Using auto-detected IIO context at URI "usb:1.11.5"
    dev 'ad9361-phy', attr 'filter_fir_config', value :'FIR Rx: 128,2 Tx: 128,2'

  •  iio = iio_sys_obj_matlab;
     iio.ip_address = '192.168.2.1';
     iio.dev_name = 'ad9361';
     iio.writeFirData('WorseFilter4MSPS.ftr');
     iio.setupImpl();
     releaseImpl(iio);

    Are you running this code only? Or using the other system object as well after?

    -Travis

  • Sorry was my fault

    Using auto-detected IIO context at URI "usb:1.12.5"
    dev 'ad9361-phy', attr 'filter_fir_config', value :'FIR Rx: 128,2 Tx: 128,2'

    Using auto-detected IIO context at URI "usb:1.12.5"
    dev 'ad9361-phy', channel 'voltage0' (input), attr 'filter_fir_en', value '1'
    dev 'ad9361-phy', channel 'voltage0' (output), attr 'filter_fir_en', value '1'

    But still not the filter with the 64 tabs

    # Generated with AD9361 Filter Design Wizard 16.1.3
    # MATLAB 9.5.0.944444 (R2018b), 19-Nov-2018 14:47:00
    # Inputs:
    # Data Sample Frequency = 4000000 Hz
    TX 3 GAIN 0 INT 1
    RX 3 GAIN -6 DEC 2
    RTX 1024000000 32000000 16000000 8000000 4000000 4000000
    RRX 1024000000 64000000 32000000 16000000 8000000 4000000
    BWTX 3283867
    BWRX 3753006
    5,1
    4,0
    -9,-2
    9,-7
    4,-10
    -23,-6
    30,4
    -10,12
    -35,7
    74,-9
    -65,-19
    -12,-8
    120,18
    -176,29
    103,6
    96,-33
    -303,-40
    343,4
    -111,56
    -312,50
    649,-25
    -588,-87
    19,-51
    800,61
    -1305,122
    947,38
    382,-117
    -2078,-155
    2995,1
    -1857,191
    -2723,174
    19420,-75
    19420,-279
    -2723,-162
    -1857,189
    2995,366
    -2078,103
    382,-347
    947,-434
    -1305,25
    800,540
    19,452
    -588,-239
    649,-752
    -312,-386
    -111,552
    343,953
    -303,190
    96,-974
    103,-1102
    -176,189
    120,1512
    -12,1137
    -65,-841
    74,-2199
    -35,-962
    -10,1965
    30,3159
    -23,347
    4,-4274
    9,-5059
    -9,1854
    4,13980
    5,23488

Reply
  • Sorry was my fault

    Using auto-detected IIO context at URI "usb:1.12.5"
    dev 'ad9361-phy', attr 'filter_fir_config', value :'FIR Rx: 128,2 Tx: 128,2'

    Using auto-detected IIO context at URI "usb:1.12.5"
    dev 'ad9361-phy', channel 'voltage0' (input), attr 'filter_fir_en', value '1'
    dev 'ad9361-phy', channel 'voltage0' (output), attr 'filter_fir_en', value '1'

    But still not the filter with the 64 tabs

    # Generated with AD9361 Filter Design Wizard 16.1.3
    # MATLAB 9.5.0.944444 (R2018b), 19-Nov-2018 14:47:00
    # Inputs:
    # Data Sample Frequency = 4000000 Hz
    TX 3 GAIN 0 INT 1
    RX 3 GAIN -6 DEC 2
    RTX 1024000000 32000000 16000000 8000000 4000000 4000000
    RRX 1024000000 64000000 32000000 16000000 8000000 4000000
    BWTX 3283867
    BWRX 3753006
    5,1
    4,0
    -9,-2
    9,-7
    4,-10
    -23,-6
    30,4
    -10,12
    -35,7
    74,-9
    -65,-19
    -12,-8
    120,18
    -176,29
    103,6
    96,-33
    -303,-40
    343,4
    -111,56
    -312,50
    649,-25
    -588,-87
    19,-51
    800,61
    -1305,122
    947,38
    382,-117
    -2078,-155
    2995,1
    -1857,191
    -2723,174
    19420,-75
    19420,-279
    -2723,-162
    -1857,189
    2995,366
    -2078,103
    382,-347
    947,-434
    -1305,25
    800,540
    19,452
    -588,-239
    649,-752
    -312,-386
    -111,552
    343,953
    -303,190
    96,-974
    103,-1102
    -176,189
    120,1512
    -12,1137
    -65,-841
    74,-2199
    -35,-962
    -10,1965
    30,3159
    -23,347
    4,-4274
    9,-5059
    -9,1854
    4,13980
    5,23488

Children
  • That filter worked perfectly fine for me. But again, are you using multiple system objects or just those 6 lines of code?

    -Travis

  • I am using multiple system objects my whole code is this:

    function TxPluto(prmTransmitter)

    close all,


    %% Initialize SDR
    sdrdev('Pluto');

    %% Setup the iio_sys_obj
     iio = iio_sys_obj_matlab;
     iio.ip_address = '192.168.2.1';
     iio.dev_name = 'ad9361';
     iio.writeFirData('WorseFilter4MSPS.ftr');
     iio.setupImpl();
     releaseImpl(iio);

    %%
    persistent Tx radio
    if isempty(Tx)
        % Initialize the components
        % Create and configure the transmitter System object
        Tx = QPSKTransmitter(...
            'UpsamplingFactor',             prmTransmitter.Interpolation, ...
            'RolloffFactor',                prmTransmitter.RolloffFactor, ...
            'RaisedCosineFilterSpan',       prmTransmitter.RaisedCosineFilterSpan, ...
            'MessageBits',                  prmTransmitter.MessageBits, ...
            'MessageLength',                prmTransmitter.MessageLength, ...
            'NumberOfMessage',              prmTransmitter.NumberOfMessage, ...
            'ScramblerBase',                prmTransmitter.ScramblerBase, ...
            'ScramblerPolynomial',          prmTransmitter.ScramblerPolynomial, ...
            'ScramblerInitialConditions',   prmTransmitter.ScramblerInitialConditions);
        
        % Create and configure the Pluto System object.
        radio = sdrtx('Pluto');    
            %designCustomFilter(radio);
            radio.RadioID                       = prmTransmitter.Address;
            radio.CenterFrequency               = prmTransmitter.PlutoCenterFrequency;
            radio.BasebandSampleRate            = prmTransmitter.PlutoFrontEndSampleRate;
            radio.SamplesPerFrame               = prmTransmitter.PlutoFrameLength;
            radio.Gain                          = prmTransmitter.PlutoGain;
            radio.ShowAdvancedProperties        = true;
            %radio.UseCustomFilter               = true;
            

    end



    currentTime = 0;
        
        % Transmission Process
    while currentTime < prmTransmitter.StopTime
        % Bit generation, modulation and transmission filtering
        data = step(Tx);
        
        % Data transmission
        step(radio, data);


        % Update simulation time
        currentTime = currentTime+prmTransmitter.FrameTime
    end
        
    release(Tx);
    release(radio);


    end

  • When you use the MathWorks authored system object, basically this call " step(radio, data)", it creates a new filter under the hood and loads it. This is done automatically so you can change the sample rate below 2.08 MHz without manually creating a filter.

    -Travis

  • Is there a way to load my manual created filter at any sample rate ?

  • The sample rate determines how many taps you have, so it depends. I would recommend just using the MathWorks method of loading filters with the link I previously sent for the specific sample rate you want.

    -Travis

  • I mean, I can create a ftr filte with the Filter Wizard and apply it on the chip.

    But when I create a ftr file also with the Filter Wizard and store it. And than apply it on the chip via iio system object it does not work.

    I mean, I do not see why I can not apply it with the iio system object I should be the same or is it not?

    My Sample rate is 4MSPS

  • As we have gone over, the following lines will write the filter file (which contains sample rates):

     iio = iio_sys_obj_matlab;
     iio.ip_address = '192.168.2.1';
     iio.dev_name = 'ad9361';
     iio.in_ch_no = 1;
     iio.out_ch_no = 1;
     iio = iio.setupImpl();
     iio.writeFirData('filter.ftr');

    If you use the MathWorks authored system objects (sdrrx('Pluto')) it will also create a filter and load it. If you want to use custom filters, MathWorks authored system objects support that directly: https://www.mathworks.com/help/supportpkg/xilinxzynqbasedradio/ug/comm.sdrtxad936x.designcustomfilter.html

    Filters created in either tool generate sample rates for the AD9363 transceiver as part of the design process.

    -Travis

  • When I run the code:

    iio = iio_sys_obj_matlab;
     iio.ip_address = '192.168.2.1';
     iio.dev_name = 'ad9361';
     iio.in_ch_no = 1;
     iio.out_ch_no = 1;
     iio = iio.setupImpl();
     iio.writeFirData('filter.ftr');

    Matlab has got an error and: Could not find target configuration device!

    Even if I got the ad9361.cfg file in my folder

    data_in_device = cf-ad9361-dds-core-lpc
    data_out_device = cf-ad9361-A
    ctrl_device = ad9361-phy
    channel = RX_LO_FREQ,IN,out_altvoltage0_RX_LO_frequency,
    channel = RX_SAMPLING_FREQ,IN,in_voltage_sampling_frequency,
    channel = RX_RF_BANDWIDTH,IN,in_voltage_rf_bandwidth,
    channel = RX1_GAIN_MODE,IN,in_voltage0_gain_control_mode,
    channel = RX1_GAIN,IN,in_voltage0_hardwaregain,
    channel = RX1_RSSI,OUT,in_voltage0_rssi,
    channel = RX2_GAIN_MODE,IN,in_voltage1_gain_control_mode,
    channel = RX2_GAIN,IN,in_voltage1_hardwaregain,
    channel = RX2_RSSI,OUT,in_voltage1_rssi,
    channel = TX_LO_FREQ,IN,out_altvoltage1_TX_LO_frequency,
    channel = TX_SAMPLING_FREQ,IN,out_voltage_sampling_frequency,
    channel = TX_RF_BANDWIDTH,IN,out_voltage_rf_bandwidth,

  • That configuration is invalid for Pluto since it has only 1 I/Q channel enabled, and you have incorrect device names.

    Something like this will work for Pluto:

    data_in_device = cf-ad9361-dds-core-lpc
    data_out_device = cf-ad9361-lpc
    ctrl_device = ad9361-phy
    channel = RX_LO_FREQ,IN,out_altvoltage0_RX_LO_frequency,
    channel = RX_SAMPLING_FREQ,IN,in_voltage_sampling_frequency,
    channel = RX_RF_BANDWIDTH,IN,in_voltage_rf_bandwidth,
    channel = RX1_GAIN_MODE,IN,in_voltage0_gain_control_mode,
    channel = RX1_GAIN,IN,in_voltage0_hardwaregain,
    channel = RX1_RSSI,OUT,in_voltage0_rssi,
    channel = TX_LO_FREQ,IN,out_altvoltage1_TX_LO_frequency,
    channel = TX_SAMPLING_FREQ,IN,out_voltage_sampling_frequency,
    channel = TX_RF_BANDWIDTH,IN,out_voltage_rf_bandwidth,

    -Travis

  • If I run the Code:

    iio = iio_sys_obj_matlab;
    iio.ip_address = '192.168.2.1';
    iio.dev_name = 'ad9361';
    iio.in_ch_no = 1;
    iio.out_ch_no = 1;
    iio = iio.setupImpl();
    iio.writeFirData('SomeFilter.ftr');
    releaseImpl(iio);

    My filter are not enabled

    Using auto-detected IIO context at URI "usb:1.62.5"
    dev 'ad9361-phy', channel 'voltage0' (input), attr 'filter_fir_en', value '0'
    dev 'ad9361-phy', channel 'voltage0' (output), attr 'filter_fir_en', value '0'