Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zero IF filter #379

Open
Mas313 opened this issue Aug 31, 2024 · 2 comments
Open

Zero IF filter #379

Mas313 opened this issue Aug 31, 2024 · 2 comments

Comments

@Mas313
Copy link

Mas313 commented Aug 31, 2024

Hi,
I want to filter out image frequencies ( positive and negative image frequencies) after downconversion to zero IF and need a band pass filter to pass frequencies between -50khz and 50 Khz. I have found fir filter in the library but it requires only one cutoff frequency. I want to implement dual channel receiver so I downconvert using nco and using following for filtering images but not achieving thr desires results as not knowing how to filter negative frequencies.

#define SAMPLERATE 1024000.0f
#define CUTOFF_HZ 50000.0f
#define NUM_SAMPLES 1024

float fc = CUTOFF_HZ/SAMPLERATE; // cutoff frequency
unsigned int h_len = 64; // filter length    
float As = 70.0f; // stop-band attenuation

float complex r[NUM_SAMPLES]; // zero if  signal nco output
float complex rf[NUM_SAMPLES]; // filtered signal

// design filter from prototype and scale to bandwidth
firfilt_crcf q = firfilt_crcf_create_kaiser(h_len, fc, As, 0.0f);
firfilt_crcf_set_scale(q, 2.0f*fc);

while (1) {
    ReadzeroIFsamples(r, NUM_SAMPLES); //
    for (int i=0; i<NUM_SAMPLES; i++)
        firfilt_crcf_push(q, r[i]);
        firfilt_crcf_execute(q, &rf[i]);
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@Mas313 and others