Updated Home (markdown)

master
proto17 2022-04-12 21:36:32 -04:00
rodzic 4363129da5
commit c2ca05144e
1 zmienionych plików z 41 dodań i 2 usunięć

43
Home.md

@ -129,10 +129,49 @@ sample_rate = 30.72e6;
start_time = 2.722209;
burst_duration = 0.00080729;
start_time_samples = int(start_time * sample_rate);
burst_duration_samples = int(burst_duration * sample_rate);
start_time_samples = round(start_time * sample_rate);
burst_duration_samples = round(burst_duration * sample_rate);
fprintf(1, 'Start sample offset: %d, sample duration: %d\n', start_time_samples, burst_duration_samples);
```
Running this script you should get the following output:
```
Start sample offset: 83626260, sample duration: 24800
```
Next the samples need to be read from the file they were recorded to. Using the function in [5] that looks like this:
```
file_path = '/path/to/your/file.fc32';
sample_rate = 30.72e6;
start_time = 2.722209;
burst_duration = 0.00080729;
start_time_samples = round(start_time * sample_rate);
burst_duration_samples = round(burst_duration * sample_rate);
samples = read_complex_floats(file_path, start_time_samples, burst_duration_samples);
length(samples)
```
The output of which should look like:
```
ans = 24800
```
Which means that `samples` now contains 24,800 complex samples.
Now that you have the samples, it's a good idea to plot them to make sure that you really got a full burst. An easy way to do this is to plot the magnitude squared (`abs(samples).^2`). Add the following to the script above:
```
figure(1);
plot(10 * log10(abs(samples).^2));
```
In my case the plot looks like this
![image](https://user-images.githubusercontent.com/4240543/163081765-bdb3debf-0363-465d-8b1e-92d645d0ddd0.png)
[4] https://github.com/gnuradio/gnuradio/blob/main/gr-utils/octave/read_complex_binary.m
[5] https://github.com/proto17/dji_droneid/blob/main/matlab/read_complex_floats.m