Commit 0ab36294 authored by thomas.forbriger's avatar thomas.forbriger
Browse files

libpsdxx [WP]: provide test plot for LogTaper

parent efb65cbd
...@@ -55,8 +55,9 @@ SOURCEFILES=$(filter-out %usage.h, $(filter-out %usage.cc, \ ...@@ -55,8 +55,9 @@ SOURCEFILES=$(filter-out %usage.h, $(filter-out %usage.cc, \
EDITFILES=Makefile $(README) \ EDITFILES=Makefile $(README) \
$(DOXYTXT) \ $(DOXYTXT) \
$(SOURCEFILES) \ $(SOURCEFILES) \
$(wildcard *.cfg) \ $(wildcard *.cfg *.gpt) \
COPYING COPYING
# ============================================================================ # ============================================================================
# check for settings expected in the environment # check for settings expected in the environment
# ---------------------------------------------- # ----------------------------------------------
...@@ -250,9 +251,19 @@ doxyview: $(DOXYWWWPATH)/html/index.html ...@@ -250,9 +251,19 @@ doxyview: $(DOXYWWWPATH)/html/index.html
# test code # test code
# --------- # ---------
testpsdxx: testpsdxx.cc testpsdxx: testpsdxx.cc install
$(CXX) -o $@ $< -I$(LOCINCLUDEDIR) -lpsdxx -ltsxx -lfourierxx -laff \ $(CXX) -o $@ $< -I$(LOCINCLUDEDIR) -lpsdxx -ltsxx -lfourierxx -laff \
-ltfxx -lfftw3 \ -ltfxx -lfftw3 \
-L$(LOCLIBDIR) $(CXXFLAGS) $(FLAGS) -L$(LOCLIBDIR) $(CXXFLAGS) $(FLAGS)
# ----------------------------------------------------------------------
# test LogTaper
LOGTAPERINDEX=3
logtaper.xxx: testpsdxx
./$< -lt=$(LOGTAPERINDEX) > $@
logtaper.ps: testlogtaper.gpt logtaper.xxx
gnuplot $<
%.psp: %.ps; gv $<; /bin/rm -fv $<
# ----- END OF Makefile ----- # ----- END OF Makefile -----
#!/usr/bin/gnuplot -persist
#
#
# G N U P L O T
# Version 5.0 patchlevel 0 last modified 2015-01-01
#
# Copyright (C) 1986-1993, 1998, 2004, 2007-2015
# Thomas Williams, Colin Kelley and many others
#
# gnuplot home: http://www.gnuplot.info
# faq, bugs, etc: type "help FAQ"
# immediate help: type "help" (plot window: hit 'h')
#
# Type `load "all.dem"` to display a large number of examples.
# They are located at /usr/share/doc/packages/gnuplot/demo/*
#
# set terminal qt 0 font "Sans,9"
set terminal postscript color solid
set output 'logtaper.ps'
set logscale x
unset logscale y
set mxtics 10
set grid
set title 'LogTaper'
set xlabel 'frequency / Hz'
set ylabel 'taper value'
plot 'logtaper.xxx' skip 12 u 2:3 w l
# EOF
...@@ -153,9 +153,10 @@ int main(int iargc, char* argv[]) ...@@ -153,9 +153,10 @@ int main(int iargc, char* argv[])
if (opt.logtaper) if (opt.logtaper)
{ {
const int nsamples=300;
cout << "test class LogTaper" << endl; cout << "test class LogTaper" << endl;
CODE( psd::TDseries linf=psd::lin_frequency(0.1,100) ); CODE( psd::TDseries linf=psd::lin_frequency(0.1,nsamples) );
CODE( psd::TDseries logf=psd::log_frequency(0.1,100,6) ); CODE( psd::TDseries logf=psd::log_frequency(0.1,nsamples,6) );
CODE( psd::helper::LogTaper logt(logf, opt.taperindex) ); CODE( psd::helper::LogTaper logt(logf, opt.taperindex) );
DUMP( logf ); DUMP( logf );
cout << PSDXX_value( logf(opt.taperindex) ) << endl; cout << PSDXX_value( logf(opt.taperindex) ) << endl;
......
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