GithubHelp home page GithubHelp logo

sdrforengineers / code Goto Github PK

View Code? Open in Web Editor NEW
53.0 53.0 32.0 63 KB

MATLAB implementations for SDR for Engineers textbook

Home Page: http://sdrforengineers.com/

License: MIT License

MATLAB 100.00%

code's People

Contributors

tfcollins avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

code's Issues

vec2mat is depreciated

In chapter4.m vec2mat is used, but that is now depreciated. Matlab recommends using reshape instead. The easiest solution is to replace vec2mat with reshape(arr, [], numcols)

Undefined and Missing Functions

The function SetPlotSize and SetPlotFont used in the code is undefined, they are used in the following list of files:

chapter.m 
chapter2.m
chapter3.m
chapter4.m
chapter5.m
chapter6.m
psk.m
robin.m
sfdr_test.m
simulated_DAC.m
time-alias.m
updownsample.m

I am using MatLab R2018a, I'll update this issue with any undefined or missing functions found in the examples as I come across them.

Source Encoding Example neglects messages with leading/trailing zeroes

I'm unsure if this is intentional or not. The supporting text does not mention what is supposed to happen to zeroes.

Assuming the purpose of the source encoding is to just replace strings of 1s with a number representing the length of said strings, then the zero preceding the string is erroneously removed from the encoded message (in reality that zero's position is used for the string length value). As a result, a binary message starting "01101110..." and a binary message starting "1101110..." both encode to decimal message "2,3,...".

Given that source encoding is meant to be a unique mapping from one domain to another, the example code gives rise to a non-unique mapping, where by "2,3" is not uniquely decode-able back to the original binary message.

I would have assumed that the zeroes have to be left well alone(?) and therefore the above messages should encode to "0, 2, 0, 3,..." and "2, 0, 3, 0,..." respectively.
If that assumption is correct, then adding:

if (enc_msg1(end) == 0)
     enc_msg1 = [enc_msg1 0];
endif

between lines 81 and 82, and 90 and 91 should resolve the issue; preserving all zeroes in the encoded message EDIT: remembering to ammend the variables numbers accordingly....

Example code is Code 4.2, in file chapter4.m

template3.m: Unexpected overflow warning

I ran the following code modified from template3.m.

framesToCollect = 1000;
frameSize = 2^15;
rx = sdrrx('Pluto');
rx.SamplesPerFrame = 2^15;
rx.CenterFrequency = 430e6;

%% Template 3
% Perform stream processing
sa3 = dsp.SpectrumAnalyzer;
sa3.SampleRate = 1e6;
framesToCollect = 1000;
% Process each frame immediately
for frame = 1:framesToCollect
    [d,valid,of] = rx();
    % Process data without overflow and is valid
    if ~valid
        warning('Data invalid')
    else
        if of
            warning('Overflow occurred')
        end
        sa3(d); % Algorithm processing
    end
end

But I got an overflow warning.

>> template_3
## Establishing connection to hardware. This process can take several seconds.
Warning: Overflow occurred 
> In template_3 (line 20) 

I cant think of why an overflow might occur. My frameSize and sampling rate tally. Might someone be able to tell why?

Does this function 'getOFDMPreambleAndPilot' comes from any toolbox?

Hi,
I was looking for some implementation of Schmidl-cox and I bumped onto this book and pluto-SDR and its really amazing.
I was trying to run the code and guess have a dependency on getOFDMPreambleAndPilot function. What toolbox do I need in order to successfully run all the codes on this git? Or Do I need to implement this on my own ?

Ashish

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.