## Visualizing the spectrum of a 433 MHz433 MHz signal in MATLAB

Started by 3 years ago●12 replies●latest reply 3 years ago●648 viewsThis is the code:

<code>[y,Fs] = audioread('HDSDR_SHORT_433920kHz_RF.wav',[5000000 10000000]); Y=fft(y); X=fftshift(Y); xx=-5000000/2:1:5000000/2; stem(xx,X) </code>

I wonder if what I'm seeing is:

- noise?
- that I truncated the signal so it's incorrect?
- the spectrum is shifted?

Here is the original recoding and the truncated signal I plotted. Basically, my experiment consists in recording a parking remote signal with my rtl2838 dongle, using the software HDSR which records the IQ data in a .wav file. I selected a centered frequency of 433 MHz433 MHz. The bandwidth is 192Khz.

Then, I want to process it in MATLAB to introduce it in a spectrum analyzer, but I need to understand what I've recoreded first, so I need help on that.

you better do the following:

<code> Y=fft(y); X=fftshift(Y); f=linspace(-Fs/2,+Fs/2,length(X)); plot(f,20*log10(abs(X))); </code> also look at time domain

thank you very much! This is the frequency plot I get:

and for the time domain, I used this code:

```
[y,Fs] = audioread('HDSDR_SHORT_433920kHz_RF.wav',[5000000 10000000]);
```

samples=0:1:5000000;
t=samples/Fs;
plot(t,y)

and I get:

I also represented the signal in the ARB Toolbox from Rohde & Schwarz:

would you know if taking only the IQ samples from [5000000 10000000] is affecting what I see? Also, should I not see a peak in the spectrum at 433MHz? I'm a bit confused on that. When I recorded the signal with the SDR dongle, I selected the center frequency to be the 433MHz, so is that what I see in the 0?

Thanks a lot!

The data you pass to fft must represent your signal in a sufficient way and you may discard repeated patterns or any section that is not relevant to your observation.

Concerning 433MHz. This is RF centre frequency and assuming no carrier leakage then there would be no peak there. Moreover I expect you have down-converted to dc (433MHz will move to dc) and you got some dc in your spectrum.

Finally have you considered your sampling rate and any aliasing as result? what is your sampling rate exactly, I assume it is 3.2Msps based on your scaling of spectrum.

Thank you very much! Yes, the sampling rate (Fs) is 3.2Msps and the bandwidth is a bit weird, because I selected in the HSDR sofware using this:

so as shown in the picture, when you click on bandwith, it says "sampling rate" and it's in Hz (also, there is an input and an output), so I assumed this is the bandwidth in Hz, and I selected the 192KHz in both (input and output).

Then, you also select the center frequency (433MHz):

so is my original signal converted to base band? So the peak in 0 Hz is the DC component? what about the rest of the tiny peaks we see in the spectrum?

or maybe the way I record my signal is incorrect? As in, the parameters I select?

I can't help with your tool setup. You haven't explained your expectations or nature of capture and you seem trying study a signal by just eyeballing (not best way). I can see a frequency at +/-1.28MHz, +/- 0.83MHz and +/-150KHz on spectrum. Time domain shows this slow one is due to repetition of fast ones. Your spectrum should be that of complex signal but you have done it on real & imaginary separately.

You need to explain more details about your capture concepts away from tool specific setups

Oh, I see... thank you. All that I wanted to do is recording a signal from my parking remote which carrier frequency is 433MHz (in Spain).

I have the rtl2838 dongle to record the signal in my PC by using the software HDSDR, so I set the center frequency in 433MHz.

Then, I got the signal recorded as a .wav file in IQ samples. As I pressed the button of the remote a second after start the recording, I only take the middle IQ samples of my recording.

Then, I did that Matlab code that I showed you and also saved the IQ samples in an .txt file to be able to see it in the ARB Toolbox software, as I showed you as well. This software also converts the .txt file into a .wv file, so I can load it in a Spectrum Analyzer.

So my goal is recording the parking remote control with my dongle rtl2838, and find a way to make sure I did it properly.

If you need more information, let me know, please.

Thank you very much!

OK I understand RF centre frequency is 433MHz. This is centre of signal at capture but what is the signal meant to be? is it meant to be a sine wave generated on/off or a band limited signal. Every man-made signal has some sort of standards or definitions on how it is created and this is missing from discussion.

thank you. That's also what I'm looking for. At the moment, I just know the signal seems to be a kind of OOK, based on these codes. Regarding to the bandwith, I'm not sure if it's about 200KHz. I read this tutorial, where the author does something similar but designing his own SDR. But I'm not sure about the bandwidth and maybe that's a limitation of my recording software.

I will focus on time domain. You already have ON/OFF states in your signal with short and wider durations of sine wave ON followed by OFF noise. (Plot magnitude of signal to get both I/Q information)

Next is to work out if you want to recover a particular data sequence.

That requires detecting those ON/OFF segments and their durations and decode to a digital pattern.

Thank you! So the magnitude of the signal would be the previous one I plotted? I mean, this one:

or you mean, I and Q separately? In that case, this is the magnitude of the I component:

and this is the Q component:

so there seem to be a different at 0 Hz.

and this is a screenshot of the IQ mangnitude when you play the waveform in the ARB Toolbox:

I'm not surre if this last picture gives you relevant information.

My goal here is to record a garage door opener signal and deliver it in a format (.wv) that a spectrum analyzing can read. So I don't need to decode the information, I just want to make sure what I recorded makes sense.

Also, regarding to the bandwidth, when you record a signal in the PC using the HDSDR software, it shows you the spectrum so it adapts the relevant bandwidth to record, so I thought the signal bandwidth I recorded is the correct one.

Thank you very much for all your help!

I meant magnitude in time domain. I don't see why you want to see spectrum as it is useful for initial checks on moving from RF to baseband. The signal in the time domain now available to you directly (baseband) and if you look at samples from 1 million to end you will see the on/off signal.

oooh...I see what you mean! I plotted what you said and I think I start seeing something now.

Well, the signal's got many samples (22991297 samples, when not taking the first million). For example, this is the magnitude of the I component in the time domain:

I highlighted in a square where I think the signal is, so probably I should plot only those samples?

Also, this is the zoom of that portion of the signal:

that pattern is repeated in every pulse, so I guess that's the code?

Thank you very much!!! :)