Skip to content

Commit

Permalink
Merge pull request #12 from v15n/fix-decimation-filter
Browse files Browse the repository at this point in the history
fixed shifting of filter history in fifth_order()
  • Loading branch information
dgiardini authored Apr 29, 2017
2 parents 0b456b5 + a2a8e78 commit b93f9f3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions rtl_ais.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,21 +154,21 @@ static void fifth_order(int16_t *data, int length, int16_t *hist)
{
int i;
int16_t a, b, c, d, e, f;
a = hist[1];
b = hist[2];
c = hist[3];
d = hist[4];
e = hist[5];
f = data[0];
a = hist[2];
b = hist[3];
c = hist[4];
d = hist[5];
e = data[0];
f = data[2];
/* a downsample should improve resolution, so don't fully shift */
data[0] = (a + (b+e)*5 + (c+d)*10 + f) >> 4;
for (i=4; i<length; i+=4) {
a = c;
b = d;
c = e;
d = f;
e = data[i-2];
f = data[i];
e = data[i];
f = data[i+2];
data[i/2] = (a + (b+e)*5 + (c+d)*10 + f) >> 4;
}
/* archive */
Expand Down

11 comments on commit b93f9f3

@enetsec
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi guys, I use rtl ais of raspberry, with the -T parameters more after 40 minutes the messages are no longer transmitted by the network having to restart the rtl_ais application.
Can someone help me?

@klapligehesten
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi enetsec, If you try describing the problem a bit more precise. I'll try to help. Fx. try to use the app with -t 30 or -t 8 end see if the app stops sooner/later.

@dgiardini
Copy link
Owner Author

@dgiardini dgiardini commented on b93f9f3 Apr 13, 2018 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NicolaiM
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the same problem as enetsec.

If I leave rtl_ais running for more than a week no messages seem to be captured and send - in my case to Aisdispatcher. As a remedy I a wrapper scripts using "timeout" that restart rtl-ais every week.

I am running in UDP mode with aisdispatcher running on same raspberrypi. I will try the above suggestions.

pi 835 834 21 Apr20 ? 03:57:31 /home/pi/rtl-ais/rtl_ais -R -h 192.168.0.40 -P 5000 -n -g 60
pi 1288 1 0 Apr20 ? 00:00:19 /home/pi/ais_dispatcher/aisdispatcher -u -h 0.0.0.0 -p 5000 -H {reciver IP's}.

Best Regards
Nicolai

@JT-Valhalla
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
I was wondering if there is any design documentation for the filters that were used? I've modeled them and the responses looks reasonable but I'd actually like to experiment with some alternatives.

It may all be a mute point because I'm also trying to compile the code under MinGW and running into compilation issues. It's a recent install of MinGW and the GCC version is 6xx, as an example a specific issue is related to "bzero" used in tcp_listener which has been deprecated. FYI, I was able to successfully compile rtl_sdr. Any advice?

JT

@dgiardini
Copy link
Owner Author

@dgiardini dgiardini commented on b93f9f3 May 18, 2018 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JT-Valhalla
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi David,

On the filters:
I saw the same filter structure used in the "rtl_fm" project which, I believe, pre-dates the "rtl_ais" project but I didn't look further for the source.

Anyway, I used a trail version of a program called ScopeFIR and imported the coefficients from "rtl_ais.c" to plot the responses. The 6-tap, FIR, filter provides low pass filtering and by changing the sampling rates to match the decimation you can see the effects on the frequency response. After the last stage there is about 6dB roll-off in the channel. The 9 section, CIC, filter is included to boost the response back up, about 4dB in band.

I think I may need to set up an older version of the environment. I had re-defined bzero in the offending file (tcp_listener.c) but different errors popped up. There were also some issues with "winsock.h" and "winsock2.h" which I dealt with by changing the order of the include files.

JT

@enetsec
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi klapligehesten, I tried to use the -t command but the application does not accept even being documented in help.

@dgiardini
Copy link
Owner Author

@dgiardini dgiardini commented on b93f9f3 Jul 26, 2018 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@enetsec
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi dgiardini, I made the updates as indicated, but there was no result.
The problem persists the same with -t 10 or 120.
I do not know what happens

@dgiardini
Copy link
Owner Author

@dgiardini dgiardini commented on b93f9f3 Aug 1, 2018 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.