5.0

5.0 | 1 rating Rate this file 25 Downloads (last 30 days) File Size: 41 KB File ID: #43386
image thumbnail

A Few Modulations

by

 

ASK, BPSK, FSK and QPSK modulations done by hand.

| Watch this File

File Information
Description

A while ago, a good friend of mine took a comms class in grad school that involved MATLAB. He's a computer scientist with a C background, so I helped him out with syntax questions and such.

One of his assignments was to implement these four modulations. The professor stressed good syntax and also told the kids to try to vectorize their code. He also had a side-challenge for fewest lines.

I decided to give it a shot as well. After my friend submitted his code, I sent him my solution, which is the content of this File Exchange submission.

There were some things that were difficult for him with MATLAB syntax. He was trying to replicate bits, the way that the comms rectpulse() function would. There are a lot of cool ways to do that type of thing using standard MATLAB syntax. I demonstrated two of them in my code. One involves repmat() and the other involves ones().

Because some of the syntax is a little obscure for some, I tried to document it extensively in the comments... to include some matrices as they are replicated.

The "help" is pretty extensive. You can play around with the options like samples_per_symbol and plotting and so on and so forth. But really, it was an exercise in minimal code. The QPSK code is the most bloated, at 7 lines of functional code. (Excluding argument checking and plotting.) FSK is the shortest at 3 lines.

Also, the dependency report is empty. i.e. this requires no toolboxes.

Required Products MATLAB
MATLAB release MATLAB 7.14 (R2012a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
18 Apr 2014 ouc  

Contact us