Skip to content

Commit

Permalink
Merge pull request #18 from darrynjordan/master
Browse files Browse the repository at this point in the history
Tweaks for modern Ubuntu.
  • Loading branch information
stpaine authored May 6, 2022
2 parents 01a5a27 + 9d3b06c commit e4a11bb
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ doc/equations/equations.pdf
tutorials/.ipynb_checkpoints/*
tutorials/__pycache__/*
tutorials/*.h5
tutorials/*.fersxml
tutorials/*.fersxml

build/
*/venv
4 changes: 2 additions & 2 deletions src/rspython.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ PythonExtension::PythonExtension(const std::string& module, const std::string& f
{
data = new PythonExtensionData;
//Import the module
PyObject *modname = PyString_FromString(module.c_str());
PyObject *modname = PyUnicode_FromString(module.c_str());
data->pModule = PyImport_Import(modname);
Py_DECREF(modname);

Expand All @@ -52,7 +52,7 @@ PythonExtension::PythonExtension(const std::string& module, const std::string& f
throw std::runtime_error("Could not import Python module "+module);
}
//Import the function
PyObject *funcname = PyString_FromString(function.c_str());
PyObject *funcname = PyUnicode_FromString(function.c_str());
data->pFunc = PyObject_GetAttr(data->pModule, funcname);
Py_DECREF(funcname);
if (!data->pFunc) {
Expand Down
3 changes: 2 additions & 1 deletion src/rssim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ void SolveRE(const Transmitter *trans, const Receiver *recv, const Target *targ,
results.power *= trans->MultipathDualFactor();
//Step 3, calculate phase shift
//See "Phase Delay Equation" in doc/equations/equations.tex
results.phase = fmod(results.delay*2*M_PI*wave->GetCarrier(), 2*M_PI);
// results.phase = fmod(results.delay*2*M_PI*wave->GetCarrier(), 2*M_PI);
results.phase = -results.delay*2*M_PI*wave->GetCarrier();
//Step 4, calculate doppler shift
//Calculate positions at the end of the pulse
Vec3 trpos_end = trans->GetPosition(time+length);
Expand Down
2 changes: 1 addition & 1 deletion tutorials/fers.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def write_xml(self):
def run(self):
# print('Launching FERS:', self.filename)
try:
sbp.run(['./server.sh'])
sbp.run(['fers', 'sim.fersxml'])
except:
print('ERROR: failed to launch - check that FERS is installed correctly.')
exit(1)
Expand Down
8 changes: 4 additions & 4 deletions tutorials/tutorial_notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"# FERS Tutorial Notebook\n",
"This notebook presents a tutorial to get FERS noobs up and running quickly.\n",
"\n",
"It is assumed that you are running FERS in a virtualbox. The server.sh file will have to be adjusted for your hostname and directories."
"It is assumed that you are running FERS locally, i.e. `fers` can be run from anywhere in your terminal. Feel free to use the server.sh file if you have a remote setup."
]
},
{
Expand All @@ -30,7 +30,7 @@
"import numpy as np\n",
"\n",
"from numpy import matlib as mb\n",
"from scipy.signal import chirp, spectrogram, lfilter, freqz, firwin, decimate, kaiserord, hilbert"
"from scipy.signal import spectrogram, decimate"
]
},
{
Expand Down Expand Up @@ -292,7 +292,7 @@
"fers_xml = fers.FersXMLGenerator(os.path.join(output_dir, FERS_XML_FILENAME))\n",
"\n",
"fers_xml.add_parameters(\n",
" t_start=0,\n",
" t_start=1/prf,\n",
" t_end=n_seconds,\n",
" sim_rate=rf_sim_rate,\n",
" bits=adc_bits\n",
Expand Down Expand Up @@ -521,7 +521,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.5"
"version": "3.10.4"
}
},
"nbformat": 4,
Expand Down

0 comments on commit e4a11bb

Please sign in to comment.