Commit 67c31843 authored by thomas.forbriger's avatar thomas.forbriger
Browse files

croposp [FIX]: fix number of samples used with logarithmic scale output

parent 76d73277
......@@ -72,13 +72,34 @@ namespace croposp {
}
// set first index to 0 - just in case
f.shift(-f.first());
unsigned int nsamples=nsv[0].series.size();
// map to logarithmic frequency scale if requested
psd::TDseries linfreq=f;
psd::TDseries freq=f;
if (opt.logscale && opt.avg_on_output)
{
freq=psd::log_frequency(linfreq, opt.n_per_decade);
}
std::vector<psd::TDseries::Tcoc> vector_of_series(nsv.size());
for (unsigned int i=0; i<nsv.size(); ++i)
{
if (opt.logscale && opt.avg_on_output)
{
vector_of_series[i]=psd::log_sampling(nsv[i].series, linfreq, freq);
}
else
{
vector_of_series[i]=nsv[i].series;
}
}
unsigned int nsamples=freq.size();
for (unsigned int i=0; i<nsamples; ++i)
{
os << f(i);
os << freq(i);
for (unsigned int j=0; j<nsv.size(); ++j)
{
const psd::TDseries::Tcoc& s=nsv[j].series;
const psd::TDseries::Tcoc& s=vector_of_series[j];
os << " " << s(i+s.first());
}
os << endl;
......@@ -87,8 +108,7 @@ namespace croposp {
// const std::string& comment,
// psd::TDseries f,
// const TNamedSeriesVector& nsv,
// const bool& verbose,
// const bool& overwrite=true)
// const Options& opt)
} // namespace croposp
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment