COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### rectangular pulse in matlab

• Email
• Follow

```Hi everyone!
(i) can anyone tell me how to construct rectangular pulse in matlab;
(ii)also plz tell the code for the input that can be given to a band pass
filter to analyse the filter. Plz tell a simple one . I hv tried a
summation of cosine of different frequencies but not got the correct
response. The code for my band pass filter design is
n1=200
f1=1000
w1=2*95/f1;
w2=2*105/f1;
wn=[w1 w2];
y1=boxcar(n1+1);
g1=hann(n1+1)
j1=y1.*g1
hd1=fir1(n1,wn,j1);
[h1,o]=freqz(hd1);
m1=20*log10(abs(h1));
plot(m1)

plz help me out .its urgent
```
 0

See related articles to this posting

```>Hi everyone!
>(i) can anyone tell me how to construct rectangular pulse in matlab;
>(ii)also plz tell the code for the input that can be given to a band pass
>filter to analyse the filter. Plz tell a simple one . I hv tried a
>summation of cosine of different frequencies but not got the correct
>response. The code for my band pass filter design is
>n1=200
>f1=1000
>w1=2*95/f1;
>w2=2*105/f1;
>wn=[w1 w2];
>y1=boxcar(n1+1);
>g1=hann(n1+1)
>j1=y1.*g1
>hd1=fir1(n1,wn,j1);
>[h1,o]=freqz(hd1);
>m1=20*log10(abs(h1));
>plot(m1)
>
>
>
>
>plz help me out .its urgent
>

rec_pulse=ones(1,12);
```
 0

```student28 wrote:
> Hi everyone!
> (i) can anyone tell me how to construct rectangular pulse in matlab;
> (ii)also plz tell the code for the input that can be given to a band pass
> filter to analyse the filter. Plz tell a simple one . I hv tried a
> summation of cosine of different frequencies but not got the correct
> response. The code for my band pass filter design is
> n1=200
> f1=1000
> w1=2*95/f1;
> w2=2*105/f1;
> wn=[w1 w2];
> y1=boxcar(n1+1);
> g1=hann(n1+1)
> j1=y1.*g1
> hd1=fir1(n1,wn,j1);
> [h1,o]=freqz(hd1);
> m1=20*log10(abs(h1));
> plot(m1)
>
>
>
>
> plz help me out .its urgent

I suggest that you write a comment for *EACH* line of code. {Full
grammatical sentence(s). Then compare your comment to the code
you wrote. I've never used matlab but some code looks suspect and
you have at least one typo.

```
 0

```On Jul 8, 9:54=A0am, "student28" <ritu_physics@n_o_s_p_a_m.yahoo.co.in>
wrote:
> Hi everyone!
> (i) can anyone tell me how to construct rectangular pulse in matlab;
> (ii)also plz tell the code for the input that can be given to a band pass
> filter to analyse the filter. Plz tell a simple one . I hv tried a
> summation of cosine of different frequencies but not got the correct
> response. The code for my band pass filter design is
> n1=3D200
> f1=3D1000
> w1=3D2*95/f1;
> w2=3D2*105/f1;
> wn=3D[w1 w2];
> y1=3Dboxcar(n1+1);
> g1=3Dhann(n1+1)
> j1=3Dy1.*g1
> hd1=3Dfir1(n1,wn,j1);
> [h1,o]=3Dfreqz(hd1);
> m1=3D20*log10(abs(h1));
> plot(m1) =A0
>
> plz help me out .its urgent

Why isn't comp.soft-sys.matlab in your newsgroup list?
i.e.,

Newsgroups: comp.dsp, comp.soft-sys.matlab

Hope this helps.

Greg
Greg
```
 0