Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions FilterReview/FilterReview.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,16 @@ function run_batch_fft(data_set) {
const sample_time = sample_rate_count / sample_rate_sum


// Hard code 50% overlap
const window_overlap = 0.5
// Overlap between windows, batch logs always use 50% so that the window size is a power of two for the windows per batch selections
let window_overlap = 0.5
if (Gyro_batch.type != "batch") {
const overlap_percent = parseFloat(document.getElementById("FFTWindow_overlap").value)
if (!(overlap_percent >= 0) || !(overlap_percent <= 90)) {
alert('Overlap must be between 0 and 90%')
throw new Error()
}
window_overlap = overlap_percent * 0.01
}

var window_size
if (Gyro_batch.type == "batch") {
Expand Down Expand Up @@ -369,6 +377,7 @@ function reset() {

document.getElementById("FFTWindow_per_batch").disabled = true
document.getElementById("FFTWindow_size").disabled = true
document.getElementById("FFTWindow_overlap").disabled = true
document.getElementById("TimeStart").disabled = true
document.getElementById("TimeEnd").disabled = true

Expand Down Expand Up @@ -2425,6 +2434,7 @@ async function load(log_file) {
document.getElementById("log_type_raw").disabled = true

document.getElementById("FFTWindow_size").disabled = use_batch
document.getElementById("FFTWindow_overlap").disabled = use_batch
document.getElementById("FFTWindow_per_batch").disabled = !use_batch


Expand Down
23 changes: 13 additions & 10 deletions FilterReview/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,22 @@ <h1 style="text-align:center; margin-block-end: 0.25em;"><a href="" style="color
<ul>
<li>Increasing window size increases frequency resolution and decreases temporal resolution. This is useful when looking at low frequencies, but due to the decreased temporal resolution longer hover flights are needed.</li>
<li>Decreasing window size reduces frequency resolution and increases temporal resolution. This is useful when using the IMU Spectrogram to review notch tracking in dynamic flight.</li>
</ul>'
</ul>
With raw sensor logging the overlap between windows can also be changed. More overlap gives more windows to average, smoothing the spectrum and giving a finer time step in the IMU Spectrogram, at the cost of calculation time. Batch logging always uses 50%.'
data-tippy-maxWidth='750px'/>
</legend>
<table>
<table style="border-spacing: 0 2px">
<tr>
<td style="width: 125px;">
<label for="FFTWindow_per_batch">Windows per batch</label><br><br>
<label for="FFTWindow_size">Windows size</label>
</td>
<td>
<input id="FFTWindow_per_batch" name="FFTWindow_per_batch" type="number" min="1" step="1" value="1" onchange="clear_calculation()" style="width:50px"/><br><br>
<input id="FFTWindow_size" name="FFTWindow_size" type="number" min="1" step="1" value="1024" onchange="fft_window_size_inc(event); clear_calculation()" style="width:50px"/>
</td>
<td style="width: 125px;"><label for="FFTWindow_per_batch">Windows per batch</label></td>
<td><input id="FFTWindow_per_batch" name="FFTWindow_per_batch" type="number" min="1" step="1" value="1" onchange="clear_calculation()" style="width:50px"/></td>
</tr>
<tr>
<td><label for="FFTWindow_size">Windows size</label></td>
<td><input id="FFTWindow_size" name="FFTWindow_size" type="number" min="1" step="1" value="1024" onchange="fft_window_size_inc(event); clear_calculation()" style="width:50px"/></td>
</tr>
<tr>
<td><label for="FFTWindow_overlap">Overlap (%)</label></td>
<td><input id="FFTWindow_overlap" name="FFTWindow_overlap" type="number" min="0" max="90" step="5" value="50" onchange="clear_calculation()" style="width:50px"/></td>
</tr>
</table>
</fieldset>
Expand Down
Loading