For: Ubuntu 20.04.6 LTS + MATLAB R2024a
ssh -X you@yourserver
#If doesn't exist:
touch ~/.Xauthority
sudo -s
% Set figure size and save
set(gcf, 'Position', [1 1 900 250]);
fig = gcf;
fig.PaperUnits = 'points';
fig.PaperPosition = [0 0 fig.Position(3) fig.Position(4)];
fig.PaperSize = [fig.Position(3) fig.Position(4)];
fig.PaperPositionMode = 'auto';
fig_pos = fig.PaperPosition;
fig.PaperSize = [fig_pos(3) fig_pos(4)];
Copyright 2023 Andras Retzler | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OT |
#We only need to normalize the inputs of a neural network, not necessarily the outputs. | |
#However, the choice of the activation function is important, e.g. it doesn't work with `jnp.tanh`. | |
import jax.numpy as jnp | |
from jax import grad, jit, vmap | |
import jax | |
from jax import random | |
from flax import linen as nn | |
from flax.training import train_state | |
from optax import adam |
F_signal = torch.fft.rfft(signal])
w = ((((torch.arange(0,301))/600)*(2*torch.pi))) #signal is 600 samples long
d_signal = torch.fft.irfft(w*torch.tensor(complex(0,1))*F_signal)*(1/dt)