Skip to content
This repository has been archived by the owner on Oct 7, 2023. It is now read-only.

Commit

Permalink
Subtree from qucsactivefilter merged in qucs
Browse files Browse the repository at this point in the history
  • Loading branch information
ra3xdh committed Jul 10, 2014
2 parents b71c224 + 927e2ea commit 873eab9
Show file tree
Hide file tree
Showing 31 changed files with 10,939 additions and 0 deletions.
19 changes: 19 additions & 0 deletions qucs/qucsactivefilter/.gitignore
@@ -0,0 +1,19 @@
*.o
*.cpp~
*.h~
qucsactivefilter
*.pro.user
Makefile
moc_*.cpp
*.sch
*.sch~
*.dat
*.dpl
qrc_*.cpp
moc_*.cxx
qrc_*.cxx
CMakeFiles
CMakeCache.txt
*.cmake
*.depends

401 changes: 401 additions & 0 deletions qucs/qucsactivefilter/AFR.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 88 additions & 0 deletions qucs/qucsactivefilter/CMakeLists.txt
@@ -0,0 +1,88 @@
PROJECT(qucsactivefilter CXX C)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
cmake_policy(VERSION 2.6)

SET(CMAKE_BUILD_TYPE Debug)

ADD_DEFINITIONS( -DHAVE_CONFIG_H )

# define variables
SET(BINARYDIR "${CMAKE_INSTALL_PREFIX}/bin/")
SET(BITMAPDIR "${CMAKE_INSTALL_PREFIX}/share/qucs/bitmaps/")
SET(DOCDIR "${CMAKE_INSTALL_PREFIX}/share/qucs/docs/")
SET(LANGUAGEDIR "${CMAKE_INSTALL_PREFIX}/share/qucs/lang/")
SET(LIBRARYDIR "${CMAKE_INSTALL_PREFIX}/share/qucs/library/")
SET(OCTAVEDIR "${CMAKE_INSTALL_PREFIX}/share/qucs/octave/")

# configure the header config.h
#CONFIGURE_FILE (
# "${PROJECT_SOURCE_DIR}/../config.h.cmake"
# "${PROJECT_BINARY_DIR}/config.h"
#)

INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")

FIND_PACKAGE( Qt4 REQUIRED )
SET( QT_USE_QTGUI TRUE )
SET( QT_USE_QTSVG TRUE )

INCLUDE( ${QT_USE_FILE} )

ADD_DEFINITIONS(${QT_DEFINITIONS})

SET(QUCS-ACTIVE-FILTER_SRCS
filter.cpp
mfbfilter.cpp
main.cpp
qf_poly.cpp
sallenkey.cpp
schcauer.cpp
transferfuncdialog.cpp
qucsactivefilter.cpp
)

SET(QUCS-ACTIVE-FILTER_MOC_HDRS
transferfuncdialog.h
qucsactivefilter.h
)

QT4_WRAP_CPP(QUCS-ACTIVE-FILTER_MOC_SRCS ${QUCS-ACTIVE-FILTER_MOC_HDRS})

SET(RESOURCES qucsactivefilter.qrc)
QT4_ADD_RESOURCES(RESOURCES_SRCS ${RESOURCES})


IF(APPLE)
# set information on Info.plist file
SET(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME} ${PROJECT_VERSION}")
SET(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_NAME} ${PROJECT_VERSION}")
SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME} ${PROJECT_VERSION}")
SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}")
SET(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT_YEAR} ${PROJECT_VENDOR}")
SET(MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_DOMAIN_SECOND}.${PROJECT_DOMAIN_FIRST}")
SET(MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT_NAME}")
SET(MACOSX_BUNDLE_COPYRIGHT "(C) 2013 Qucs team" )
SET(MACOSX_BUNDLE_ICON_FILE qucsactivefilter.icns)

# set where in the bundle to put the icns file
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/../qucs/bitmaps/qucsactivefilter.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
# include the icns file in the target
SET(QUCS-ACTIVE-FILTER_SRCS ${QUCS-ACTIVE-FILTER_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/../qucs/bitmaps/qucsactivefilter.icns)

ENDIF(APPLE)

ADD_EXECUTABLE(qucsactivefilter MACOSX_BUNDLE WIN32
${QUCS-ACTIVE-FILTER_SRCS}
${QUCS-ACTIVE-FILTER_MOC_SRCS}
${RESOURCES_SRCS} )

TARGET_LINK_LIBRARIES(qucsactivefilter ${QT_LIBRARIES})

INSTALL(TARGETS qucsactivefilter
BUNDLE DESTINATION bin COMPONENT Runtime
RUNTIME DESTINATION bin COMPONENT Runtime
)

# man pages
INSTALL( FILES qucsactivefilter.1 DESTINATION share/man/man1 )

36 changes: 36 additions & 0 deletions qucs/qucsactivefilter/QFilterSintez.pro
@@ -0,0 +1,36 @@
#-------------------------------------------------
#
# Project created by QtCreator 2014-04-10T18:36:21
#
#-------------------------------------------------

QT += core gui svg

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = QFilterSintez
TEMPLATE = app


SOURCES += main.cpp\
filter.cpp \
sallenkey.cpp \
mfbfilter.cpp \
qf_poly.cpp \
schcauer.cpp \
transferfuncdialog.cpp \
qucsactivefilter.cpp

HEADERS += \
filter.h \
sallenkey.h \
mfbfilter.h \
qf_poly.h \
qf_matrix.h \
schcauer.h \
transferfuncdialog.h \
bessel.h \
qucsactivefilter.h

RESOURCES += \
qucsactivefilter.qrc
2 changes: 2 additions & 0 deletions qucs/qucsactivefilter/README
@@ -0,0 +1,2 @@
QFilterSintez is tool for sintezing active and passive analog filters.

57 changes: 57 additions & 0 deletions qucs/qucsactivefilter/bessel-poles.m
@@ -0,0 +1,57 @@
#!/usr/bin/octave -qf

printf("Generating bessel.h...\n");

maxorder=20;

fid=fopen("bessel.h","w");
fprintf(fid,"#ifndef BESSEL_H\n");
fprintf(fid,"#define BESSEL_H\n");
fprintf(fid,"//Bessel coeffs table\n //Generated automatically! DO NOT EDIT!!!\n\n\n");
fprintf(fid,"\n\ndouble BesselPoles[%d][%d]={\n\n",maxorder,2*maxorder);

for n=1:maxorder;

fprintf(fid,"/* %d th order */ {\n",n);
b=1;
for k=1:n+1;
b(k)=factorial(2*n-(k-1))/((2^(n-(k-1)))*factorial(k-1)*factorial(n-(k-1)));
endfor;
b=fliplr(b);
#disp(b);
#printf("Bessel polynomial %dth order poles:",n);
poles=roots(b);
Np=length(poles);

for i=1:Np;
fprintf(fid," %f, ",real(poles(i)));
#fprintf(fid,"\t%f,\n",imag(poles(i)));
if (i==maxorder)
fprintf(fid," %f \n",imag(poles(i)));
else
fprintf(fid," %f, ",imag(poles(i)));
endif;
endfor;

for i=Np+1:maxorder;
#fprintf(fid," 0.0,\n");
if (i==maxorder)
fprintf(fid," 0.0 \n");
else
fprintf(fid," 0.0, ");
endif;
endfor;

if (n==maxorder)
fprintf(fid,"\t}\n");
else
fprintf(fid,"\t},\n");
endif;

endfor;

fprintf(fid,"\n};\n");
fprintf(fid,"#endif\n");
fclose(fid);

printf("bessel.h successfully generated!\n");
73 changes: 73 additions & 0 deletions qucs/qucsactivefilter/bessel.h
@@ -0,0 +1,73 @@
#ifndef BESSEL_H
#define BESSEL_H
//Bessel coeffs table
//Generated automatically! DO NOT EDIT!!!




double BesselPoles[20][40]={

/* 1 th order */ {
-1.000000, 0.000000, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
},
/* 2 th order */ {
-1.500000, 0.866025, -1.500000, -0.866025, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
},
/* 3 th order */ {
-1.838907, 1.754381, -1.838907, -1.754381, -2.322185, 0.000000, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
},
/* 4 th order */ {
-2.103789, 2.657418, -2.103789, -2.657418, -2.896211, 0.867234, -2.896211, -0.867234, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
},
/* 5 th order */ {
-2.324674, 3.571023, -2.324674, -3.571023, -3.646739, 0.000000, -3.351956, 1.742661, -3.351956, -1.742661, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
},
/* 6 th order */ {
-2.515932, 4.492673, -2.515932, -4.492673, -3.735708, 2.626272, -3.735708, -2.626272, -4.248359, 0.867510, -4.248359, -0.867510, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
},
/* 7 th order */ {
-2.685677, 5.420694, -2.685677, -5.420694, -4.070139, 3.517174, -4.070139, -3.517174, -4.971787, 0.000000, -4.758291, 1.739286, -4.758291, -1.739286, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
},
/* 8 th order */ {
-2.838984, 6.353911, -2.838984, -6.353911, -4.368289, 4.414443, -4.368289, -4.414443, -5.204841, 2.616175, -5.204841, -2.616175, -5.587886, 0.867614, -5.587886, -0.867614, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
},
/* 9 th order */ {
-2.979261, 7.291464, -2.979261, -7.291464, -4.638440, 5.317272, -4.638440, -5.317272, -5.604422, 3.498157, -5.604422, -3.498157, -6.297019, 0.000000, -6.129368, 1.737848, -6.129368, -1.737848, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
},
/* 10 th order */ {
-3.108916, 8.232699, -3.108916, -8.232699, -4.886220, 6.224985, -4.886220, -6.224985, -5.967528, 4.384947, -5.967528, -4.384947, -6.615291, 2.611568, -6.615291, -2.611568, -6.922045, 0.867665, -6.922045, -0.867665, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
},
/* 11 th order */ {
-3.229722, 9.177112, -3.229722, -9.177112, -5.115648, 7.137021, -5.115648, -7.137021, -6.301337, 5.276192, -6.301337, -5.276192, -7.057892, 3.489015, -7.057892, -3.489015, -7.622340, 0.000000, -7.484230, 1.737103, -7.484230, -1.737103, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
},
/* 12 th order */ {
-3.343023, 10.124297, -3.343023, -10.124297, -5.329709, 8.052907, -5.329709, -8.052907, -6.611004, 6.171535, -6.611004, -6.171535, -7.465571, 4.370170, -7.465571, -4.370170, -7.997271, 2.609067, -7.997271, -2.609067, -8.253422, 0.867694, -8.253422, -0.867694, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
},
/* 13 th order */ {
-3.449867, 11.073929, -3.449867, -11.073929, -5.530681, 8.972248, -5.530681, -8.972248, -6.900373, 7.070644, -6.900373, -7.070644, -7.844380, 5.254903, -7.844380, -5.254903, -8.470592, 3.483868, -8.470592, -3.483868, -8.947710, 0.000000, -8.830252, 1.736666, -8.830252, -1.736666, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
},
/* 14 th order */ {
-3.551087, 12.025738, -3.551087, -12.025738, -5.720352, 9.894708, -5.720352, -9.894708, -7.172396, 7.973217, -7.172396, -7.973217, -8.198847, 6.143041, -8.198847, -6.143041, -8.911001, 4.361604, -8.911001, -4.361604, -9.363146, 2.607553, -9.363146, -2.607553, -9.583171, 0.867711, -9.583171, -0.867711, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
},
/* 15 th order */ {
-3.647357, 12.979501, -3.647357, -12.979501, -5.900152, 10.819999, -5.900152, -10.819999, -7.429397, 8.878983, -7.429397, -8.878983, -8.532459, 7.034394, -8.532459, -7.034394, -9.323599, 5.242259, -9.323599, -5.242259, -9.859567, 3.480671, -9.859567, -3.480671, -10.273109, 0.000000, -10.170914, 1.736389, -10.170914, -1.736389, 0.0, 0.0, 0.0, 0.0, 0.0
},
/* 16 th order */ {
-3.739232, 13.935028, -3.739232, -13.935028, -6.071241, 11.747875, -6.071241, -11.747875, -7.673241, 9.787697, -7.673241, -9.787697, -8.847968, 7.928773, -8.847968, -7.928773, -9.712326, 6.125761, -9.712326, -6.125761, -10.325121, 4.356163, -10.325121, -4.356163, -10.911887, 0.867721, -10.911887, -0.867721, -10.718985, 2.606568, -10.718985, -2.606568, 0.0, 0.0, 0.0, 0.0
},
/* 17 th order */ {
-3.827174, 14.892159, -3.827174, -14.892159, -6.234581, 12.678120, -6.234581, -12.678120, -7.905450, 10.699145, -7.905450, -10.699145, -9.147588, 8.825998, -9.147588, -8.825998, -10.080296, 7.012010, -10.080296, -7.012010, -10.764132, 5.234075, -10.764132, -5.234075, -11.233439, 3.478542, -11.233439, -3.478542, -11.598530, 0.000000, -11.508076, 1.736203, -11.508076, -1.736203, 0.0, 0.0, 0.0
},
/* 18 th order */ {
-3.911572, 15.850754, -3.911572, -15.850754, -6.390973, 13.610547, -6.390973, -13.610547, -8.127284, 11.613132, -8.127284, -11.613132, -9.433133, 9.725901, -9.433133, -9.725901, -10.430010, 7.900893, -10.430010, -7.900893, -11.180044, 6.114391, -11.180044, -6.114391, -11.718943, 4.352488, -11.718943, -4.352488, -12.068139, 2.605877, -12.068139, -2.605877, -12.239902, 0.867741, -12.239902, -0.867741, 0.0, 0.0
},
/* 19 th order */ {
-3.992759, 16.810692, -3.992759, -16.810692, -6.541095, 14.544991, -6.541095, -14.544991, -8.339801, 12.529484, -8.339801, -12.529484, -9.706101, 10.628321, -9.706101, -10.628321, -10.763544, 8.792290, -10.763544, -8.792290, -11.575589, 6.997092, -11.575589, -6.997092, -12.179243, 5.228415, -12.179243, -5.228415, -12.597062, 3.477100, -12.597062, -3.477100, -12.923980, 0.000000, -12.842816, 1.736037, -12.842816, -1.736037, 0.0
},
/* 20 th order */ {
-4.071019, 17.771869, -4.071019, -17.771869, -6.685527, 15.481306, -6.685527, -15.481306, -8.543895, 13.448046, -8.543895, -13.448046, -9.967765, 11.533112, -9.967765, -11.533112, -11.082571, 9.686112, -11.082571, -9.686112, -11.953103, 7.881991, -11.953103, -7.881991, -12.617294, 6.106632, -12.617294, -6.106632, -13.098755, 4.349634, -13.098755, -4.349634, -13.567377, 0.867486, -13.567377, -0.867486, -13.412693, 2.605660, -13.412693, -2.605660
}

};
#endif

0 comments on commit 873eab9

Please sign in to comment.